forked from commaai/cabana
-
Notifications
You must be signed in to change notification settings - Fork 0
/
craco.config.js
40 lines (39 loc) · 1.06 KB
/
craco.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
35
36
37
38
39
40
/* eslint-disable */
const WorkerLoaderPlugin = require('craco-worker-loader');
const SentryPlugin = require('craco-sentry-plugin');
module.exports = function ({ env }) {
const plugins = [
{
plugin: WorkerLoaderPlugin
}
];
if (process.env.NODE_ENV === 'production' && process.env.SENTRY_AUTH_TOKEN) {
plugins.push({
plugin: SentryPlugin
});
}
return {
plugins,
jest: {
configure: (jestConfig, { env, paths }) => {
jestConfig.testPathIgnorePatterns = ['node_modules', '__puppeteer__'];
return jestConfig;
}
},
webpack: {
configure: (webpackConfig, { env, paths }) => {
webpackConfig.output.globalObject = 'this';
webpackConfig.optimization.minimizer = webpackConfig.optimization.minimizer.map(
(plugin) => {
if (plugin.constructor.name !== 'TerserPlugin') {
return plugin;
}
plugin.options.terserOptions.keep_fnames = true;
return plugin;
}
);
return webpackConfig;
}
}
};
};