-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathconfig-overrides.js
29 lines (25 loc) · 993 Bytes
/
config-overrides.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
const path = require('path');
const srcRoot = path.resolve(__dirname, 'src');
const uiKitRoot = path.resolve(__dirname, 'node_modules/@yandex-cloud/uikit');
module.exports = {
webpack: (config, env) => {
//do stuff with the webpack config...
const oneOfRule = config.module.rules.find((r) => r.oneOf);
oneOfRule.oneOf.splice(0, 0, {
test: /\.svg$/,
include: [path.resolve(srcRoot, 'assets/icons'), path.resolve(uiKitRoot, 'assets/icons')],
loader: '@svgr/webpack',
options: {dimensions: false},
});
if (env === 'production') {
config.output.publicPath = 'resources/';
config.output.path = path.resolve(__dirname, 'build/');
}
return config;
},
jest: (config) => {
// see https://github.com/timarney/react-app-rewired/issues/241
config.transformIgnorePatterns = ["node_modules/(?!(@yandex-cloud)/)"];
return config;
},
};