rollup-plugin-svelte-inline-svg
v0.1.0
Published
Convert .svg files to svelte components
Downloads
3
Readme
rollup-plugin-svelte-inline-svg
A simple plugin to import svg files as svelte components. This is intended to be used with rollup-plugin-svelte and is based on rollup-plugin-vue-inline-svg
Note:
.svg
files are valid svelte components, but they must be renamed with the.svelte
extension, this plugin compiles.svg
files without renaming, it is useful when you share.svg
files with other projects
installation
npm install --save-dev rollup-plugin-svelte-inline-svg
usage
rollup.config.js
import svg from 'rollup-plugin-svelte-inline-svg';
export default {
// ...
plugins: [
svg(config)
]
}
config
By default this plugin will attempt to transform all files that end with the extension .svg
.
You can be more explicit by passing include and exclude options.
// `include` and `exclude` can each be a minimatch
// pattern, or an array of minimatch patterns, relative to process.cwd()
{
include: string or array of minimatch,
exclude: string or array,
}