forked from kyma-project/busola
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config-overrides.js
52 lines (48 loc) · 1.48 KB
/
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// this overrides configs of webpack and jest. See react-app-rewired documentation for details
const path = require('path');
const webpack = require('webpack');
const CopyPlugin = require('copy-webpack-plugin');
module.exports = {
webpack: function override(config, env) {
config.resolve.alias = {
// register aliases also in jsconfig.json
shared: path.resolve(__dirname, 'src/shared'),
...config.resolve.alias,
};
config.resolve.extensions = [...config.resolve.extensions, '.ts', '.tsx'];
config.plugins = [
...config.plugins,
new webpack.DefinePlugin({
'process.env.IS_DOCKER': env.IS_DOCKER,
}),
new CopyPlugin({
patterns: [
{
from: 'resources/resource-validation/rule-sets/**/*.yaml',
to: 'resource-validation/rule-set.yaml',
transformAll(assets) {
return assets.reduce((accumulator, asset) => {
return `${accumulator}---\n${asset.data}\n`;
}, '');
},
},
],
}),
];
return config;
},
jest: function(config) {
config.moduleNameMapper = {
'^shared/?(.*)': '<rootDir>/src/shared/$1',
...config.moduleNameMapper,
};
config.transformIgnorePatterns = [
'node_modules/(?!(@ui5|lit-html|d3|internmap)).*\\.js$',
];
config.snapshotSerializers = [
'enzyme-to-json/serializer',
...(config.snapshotSerializers || []),
];
return config;
},
};