Repository navigation
Expand file tree
/
Copy pathcraco.config.js
More file actions
59 lines (57 loc) · 1.5 KB
/
Copy pathcraco.config.js
File metadata and controls
59 lines (57 loc) · 1.5 KB
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
53
54
55
56
57
58
59
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const { compilerOptions } = require('./tsconfig.json');
const { pathsToAliasNameMapper, pathsToModuleNameMapper } = require('./scripts/helpers.js');
module.exports = {
devServer: {
port: 5001,
},
webpack: {
plugins: {
add: [
new BundleAnalyzerPlugin({
analyzerMode: 'static',
openAnalyzer: false,
generateStatsFile: true,
reportFilename: '../bundle-report.html',
statsFilename: '../bundle-stats.json',
}),
],
},
alias: {
...pathsToAliasNameMapper(compilerOptions.paths),
},
},
jest: {
configure: {
moduleNameMapper: {
...pathsToModuleNameMapper(compilerOptions.paths, {
prefix: '<rootDir>/src/',
}),
},
},
},
plugins: [
{
plugin: {
overrideJestConfig: ({ jestConfig }) => {
jestConfig.reporters = jestConfig.reporters ?? ['default'];
if (process.env.CI) {
jestConfig.reporters.push([
'jest-junit',
{
outputDirectory: 'reports/junit',
ancestorSeparator: ' › ',
uniqueOutputName: 'false',
suiteNameTemplate: '{filepath}',
classNameTemplate: '{classname}',
titleTemplate: '{title}',
},
]);
}
return jestConfig;
},
},
options: {},
},
],
};