0.1.3 • Published 3 years ago
svg-px2rem-loader v0.1.3
SEMI SVG FILE TOOL
This is a development environment which convert svg file px to rem tool
By the way, you probably use
svg-inline-loader
of matching.svg
extension files, So you can get a prop first.
Options
name | type | default | description |
---|---|---|---|
rootValue | number | 32 | a root value for convert px to rem, it likes root(html) font-size |
isLastLoader | boolean | false | if set true means this loader is the lastest loader for svg file |
Example
// webpack.config.js
module: {
rules: [
{
test: /\.svg$/,
use: [
{
loader: 'svg-inline-loader',
options: {
removeSVGTagAttrs: false,
},
},
{
loader: path.resolve(__dirname, '../dist/index.js'),
options: {
rootValue: 32,
},
},
],
},
],
},
You can also use it without other svg-laoder like svg-inline-loader
module: {
rules: [
{
test: /\.svg$/,
use: [
{
loader: path.resolve(__dirname, '../dist/index.js'),
options: {
rootValue: 32,
isLastLoader: true,
},
},
],
},
],
},