rollup-plugin-svgr

2.0.0 • Public • Published

rollup-plugin-svgr

simple rollup plugin svgr without svgo or babel

Install

npm install --save-dev rollup-plugin-svgr

Alternatives

Official https://www.npmjs.com/package/@svgr/rollup which has svgo and babel enabled by default, unlike this library.

Usage

{
  plugins: [svgr()];
}
{
  plugins: [svgr({ native: true })];
}

By default, babel is not enabled. First, you probably need @babel/core, @babel/preset-react and @babel/preset-env installed, then pass babel option:

{
  plugins: [
    svgr({
      babel: {
        presets: ['@babel/preset-env', '@babel/preset-react'],
      },
    }),
  ];
}

No svgo enabled

Svgo at runtime is costly, consider using a tool like lint-staged-imagemin instead, or simply run and commit svgo modified files.

Readme

Keywords

none

Package Sidebar

Install

npm i rollup-plugin-svgr

Weekly Downloads

48

Version

2.0.0

License

ISC

Unpacked Size

9.99 kB

Total Files

12

Last publish

Collaborators

  • churpeau