-
Notifications
You must be signed in to change notification settings - Fork 2
/
craco.config.js
35 lines (33 loc) · 1.02 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
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const WebpackBar = require('webpackbar');
const CracoAlias = require('craco-alias');
process.env.BROWSER = 'none';
module.exports = {
webpack: {
configure: (webpackConfig) => {
// Remove or modify the Prettier plugin
webpackConfig.plugins = webpackConfig.plugins.filter(plugin =>
!(plugin.constructor && plugin.constructor.name === 'PrettierPlugin')
);
return webpackConfig;
},
plugins: [
new WebpackBar({ profile: true }),
...(process.env.NODE_ENV === 'development' ? [new BundleAnalyzerPlugin({ openAnalyzer: false })] : []),
],
},
plugins: [
{
plugin: CracoAlias,
options: {
source: 'tsconfig',
// baseUrl SHOULD be specified
// plugin does not take it from tsconfig
baseUrl: './src/',
/* tsConfigPath should point to the file where "baseUrl" and "paths"
are specified*/
tsConfigPath: './tsconfig.paths.json',
},
},
],
};