forked from commercetools/merchant-center-application-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
svgr.config.js
34 lines (32 loc) · 810 Bytes
/
svgr.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* eslint-disable global-require */
const path = require('path');
const indexTemplate = (filePaths) => {
const exportEntries = filePaths.map((filePath) => {
const basename = path.basename(filePath, path.extname(filePath));
const exportName = `${basename}SvgIcon`;
return `export { default as ${exportName} } from './${basename}'`;
});
return exportEntries.join('\n');
};
/**
* @type {import('@svgr/core').Config}
*/
module.exports = {
icon: false,
svgoConfig: {
plugins: [
{
// https://github.com/svg/svgo#default-preset
name: 'preset-default',
params: {
overrides: {
removeViewBox: false,
},
},
},
'prefixIds',
],
},
plugins: ['@svgr/plugin-svgo', '@svgr/plugin-jsx'],
indexTemplate,
};