-
Notifications
You must be signed in to change notification settings - Fork 1
/
svgr.config.js
32 lines (30 loc) · 719 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
const path = require('path');
function defaultIndexTemplate(filePaths) {
const exportEntries = filePaths.map((obj) => {
// const basename = path.basename(obj.path, path.extname(obj.path));
const basename = path.basename(obj, path.extname(obj)); // regression in svgr v8
return `export { default as ${basename} } from './${basename}'`;
});
return exportEntries.join('\n');
}
module.exports = {
native: true,
typescript: true,
filenameCase: 'camel',
index: false,
indexTemplate: defaultIndexTemplate,
svgoConfig: {
plugins: [
{
name: 'preset-default',
params: {
overrides: {
// cleanupIDs: false,
removeUselessDefs: false,
},
},
},
'removeXMLNS',
],
},
};