Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

Rollup plugin to transform SVGs into Svelte components.

License

Notifications You must be signed in to change notification settings

metafy-gg/rollup-plugin-svelte-svg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rollup Svelte SVG

Rollup plugin to transform SVGs into Svelte components.

It also optimizes your SVGs by running them thru svgo.

Note

This package is not published to NPM at this point in time.

Usage

<script>
  import MyIcon from 'assets/my-icon.svg';
</script>

<MyIcon width={42} height={42} />

Setup

rollup.config.js

const svelteSVG = require("rollup-plugin-svelte-svg");

// Sapper
export default {
  client: {
    // ...
    plugins: [
      svelteSVG({ svgoConfig: {}, ssr: false });
    ]
  },
  server: {
    // ...
    plugins: [
      svelteSVG({ svgoConfig: {}, ssr: true });
    ]
  }
}

Credits

This plugin is based on the work from the following projects:

License

MIT

About

Rollup plugin to transform SVGs into Svelte components.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published