codefeathers / rollup-plugin-svelte-svg

Import SVG files as Svelte Components
MIT License
76 stars 12 forks source link

Default Props #16

Open janosh opened 3 years ago

janosh commented 3 years ago

What do you think of adding the ability to specify default props in the plugin settings? My use case would be

// rollup.config.js
import svelteSVG from "rollup-plugin-svelte-svg";

const defaultProps = { height: `1em`, style: `vertical-align: middle;` }

export default {
    client: {
        plugins: [
            svelteSVG({ dev, defaultProps }),            
        ],
        ...
    },
    server: {
        plugins: [
            svelteSVG({ generate: "ssr", dev, defaultProps }),
        ],
        ...
    }
}