rollup-plugin-svelte-svg icon indicating copy to clipboard operation
rollup-plugin-svelte-svg copied to clipboard

Default Props

Open janosh opened this issue 4 years ago • 0 comments
trafficstars

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 }),
        ],
        ...
    }
}

janosh avatar Dec 19 '20 07:12 janosh