Rollup plugin to import SVG files on JavaScript / TypeScript
npm install --save-dev @ponday/rollup-plugin-svg
Import and add this plugin to plugins
option.
import svg from '@ponday/rollup-plugin-svg';
export default {
entry: 'src/input.js',
dest: 'dist/output.js',
plugins: [
svg()
]
};
You can use following options.
value: text
or base64
(default: text
)
Import format. SVG files will format to base64 before import if you specify base64
.
MIT