🍣 A Rollup plugin which imports a Rollup bundle as a string.
This plugin requires an LTS Node version (v8.0.0+) and Rollup v1.20.0+.
Using npm:
npm install rollup-plugin-svg-store --save-dev
Assuming a src/index.js
exists and contains code like the following:
import icons from './icons/*.svg';
console.log(icons);
Create a rollup.config.js
configuration file and import the plugin:
import svgStore from 'rollup-plugin-svg-store';
export default {
input: 'src/index.js',
output: {
dir: 'output',
format: 'cjs'
},
plugins: [svgStore()]
};
Then call rollup
either via the CLI or the API.
Type: Object
Default: {}
The options to forward to svgstore
.
Type: Object
Default: {}
The options to forward to svgo
.
Type: String
Default: ""
The string to prepend to every icon ID.
Type: String
| Array[...String]
Default: null
A minimatch pattern, or array of patterns, which specifies the files in the build the plugin should ignore. By default no files are ignored.
Type: String
| Array[...String]
Default: null