Open liulib opened 2 years ago
In vue2 and webpack, i use svgo-loader to remove fill like this
module.exports = { chainWebpack: config => { const dir = path.resolve(__dirname, 'src/assets/icons'); config.module .use('svgo-loader') .loader('svgo-loader') .tap(options => ({ ...options, plugins: [ { name: 'removeAttrs', params: { attrs: 'fill' } }, { name: 'removeTitle' } ] })) .end(); } };
thanks for helping
You must add svgoOptions property in vite.config.js
createSvgIconsPlugin({ // ---- svgoOptions: { plugins: [ { name: 'removeAttrs', params: { attrs: ['class', 'data-name', 'fill', 'stroke'], }, }, ], }, // ---- }),
In vue2 and webpack, i use svgo-loader to remove fill like this
thanks for helping