@mapbox/svg-react-transformer-loader

Webpack loader to transform SVG files into React components

Stats

StarsIssuesVersionUpdatedCreatedSize
@mapbox/svg-react-transformer-loader
4122.0.12 years ago4 years agoMinified + gzip package size for @mapbox/svg-react-transformer-loader in KB

Readme

@mapbox/svg-react-transformer-loader

A Webpack loader to transform SVG files into React component modules.

Runs SVG files through the toComponentModule function of svg-react-transformer. Please read the svg-react-transformer documentation for more details and code examples.

Installation

npm install @mapbox/svg-react-transformer-loader

Usage

Follow the instructions for using Webpack loaders.

You can pass all of the options from svg-react-transformer's toComponentModule function (e.g. SVGO plugins, a component template).

By default, the output of this loader is precompiled with Babel. You can bypass this step (and use your own compilation) by passing the additional option precompile: false.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.