Rollup plugin to extract SVG imports from your bundle and generate an external SVG sprite file, with optional optimization via SVGO. Current stable version is 1.0.0. Released on a low cadence. Key differentiators: native Rollup integration using generateBundle hook, support for SVGO optimization, minification enabled by default, and tests with 100% code coverage. Alternative to webpack-based solutions like svg-sprite-loader.
npm install rollup-plugin-svg-spriteVerified import paths — ran on the pinned version, not inferred.
Rollup config using rollup-plugin-svg-sprite to generate an external SVG sprite from imported SVGs.
Replace `prettify: true/false` with `minify: false` if you need unminified sprite.
Upgrade Node to version 8.3 or higher.
Upgrade plugin to v0.3.0+ and use the new `generateBundle` hook.
Upgrade Rollup to 1.0.0 or later, and plugin to v0.3.0+.
Add a <script> or <link> to the generated sprite file in your HTML, or use a loader that injects it automatically.
Use `import svgSprite from 'rollup-plugin-svg-sprite'` in an ES module context.
Run `npm install rollup-plugin-svg-sprite --save-dev` or `yarn add rollup-plugin-svg-sprite --dev`.
Provide an `outputFolder` string, e.g., `svgSprite({ outputFolder: 'dist/public' })`.No dependency data recorded yet.