@svgr/webpack
Webpack loader for SVGR.
Usage
In your webpack.config.js
:
In your code:
Passing options
Using with url-loader
or file-loader
url-loader
or file-loader
It is possible to use it with url-loader
or file-loader
.
In your webpack.config.js
:
In your code:
Use your own Babel configuration
By default, @svgr/webpack
includes a babel-loader
with an optimized configuration. In some case you may want to apply a custom one (if you are using Preact for an example). You can turn off Babel transformation by specifying babel: false
in options.
Handle SVG in CSS, Sass or Less
It is possible to detect the module that requires your SVG using Rule.issuer
in Webpack. Using it you can specify two different configurations for JavaScript and the rest of your files.
License
MIT
Last updated