svg-scaler-loader

0.0.5 • Public • Published

SVG Scaler Loader

Scale your svg files

Install

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.

Package Sidebar

Install

npm i svg-scaler-loader

Weekly Downloads

4

Version

0.0.5

License

MIT

Unpacked Size

6.98 kB

Total Files

9

Last publish

Collaborators

  • madzhup