0.0.5 • Published 5 years ago
svg-scaler-loader v0.0.5
Install
yarn add style-loader --devor using npm
npm install style-loader --save-devIt'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.