0.1.0 • Published 6 years ago
rollup-plugin-svelte-inline-svg v0.1.0
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:
.svgfiles are valid svelte components, but they must be renamed with the.svelteextension, this plugin compiles.svgfiles without renaming, it is useful when you share.svgfiles with other projects
installation
npm install --save-dev rollup-plugin-svelte-inline-svgusage
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,
}0.1.0
6 years ago