0.1.3 • Published 3 years ago

svg-px2rem-loader v0.1.3

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

SEMI SVG FILE TOOL

github-build npm-download npm-licence github-commit

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

nametypedefaultdescription
rootValuenumber32a root value for convert px to rem, it likes root(html) font-size
isLastLoaderbooleanfalseif 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,
                    },
                },
            ],
        },
    ],
},

LICENSE

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago