0.0.5 • Published 4 years ago

svg-scaler-loader v0.0.5

Weekly downloads
94
License
MIT
Repository
github
Last release
4 years ago

Install

yarn add style-loader --dev

or using npm

npm install style-loader --save-dev

It's recommended to combine svg-scaler-loader with the @svgr/webpack

component.js

import Icon from './icon.svg'

webpack.config.js

{
  module: {
    rules: [
      {
        test: /\.svg$/,
        use: [
          { loader: '@svgr/webpack' },
          {
            loader: 'svg-scaler-loader',
            options: {
              width: 24,
            }
          }
        ]
      }
    ]
  }
}

Options

width

type:number, will make the svg scale to the size by the number, will fix to square, unity all svg files to same size.

scale

type:number, just normal scale, but if have the width or the height option, the scale will not work.

0.0.5

4 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago