grafana/packages/grafana-icons/.svgrrc.cjs
2024-03-26 13:58:25 +02:00

33 lines
716 B
JavaScript

/**
* Reference: https://react-svgr.com/docs/options/
*/
module.exports = {
icon: '{dir}/[name].gen.js',
typescript: true,
jsxRuntime: 'automatic',
outDir: './src/icons-gen',
template: require('./templates/icon.cjs'),
indexTemplate: require('./templates/index.cjs'),
memo: true,
svgoConfig: {
plugins: [
// Sanitise the SVGs
'removeScriptElement',
],
},
jsx: {
babelConfig: {
plugins: [
// Remove fill and id attributes from SVG child elements
[
'@svgr/babel-plugin-remove-jsx-attribute',
{
elements: ['path', 'g', 'clipPath'],
attributes: ['id', 'fill'],
},
],
],
},
},
};