rollup-plugin-rawsvg
v1.0.2
Published
Import SVG images
Downloads
36
Maintainers
Readme
rollup-plugin-rawsvg
Import SVG raw files
Installation
yarn install rollup-plugin-raw-svg --dev
Usage
// rollup.config.js
import rawsvg from 'rollup-plugin-rawsvg';
export default {
entry: 'src/input.js',
dest: 'dist/output.js',
plugins: [
rawsvg()
]
};
You can use svgs in your bundle thusly:
import iconMenu from './icon/menu.svg'
document.body.appendChild( iconMenu )
SVGs are not encoded using base64, it will only import raw files as text
Sources
This plugin was built (based on the rollup-plugin-svg) but remove base64 encoding mecanism
License
MIT