rollup-plugin-svelte-inline-svg

0.1.0 • Public • Published

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,
}

/rollup-plugin-svelte-inline-svg/

    Package Sidebar

    Install

    npm i rollup-plugin-svelte-inline-svg

    Weekly Downloads

    1

    Version

    0.1.0

    License

    MIT

    Unpacked Size

    3.94 kB

    Total Files

    5

    Last publish

    Collaborators

    • vikignt