-
Notifications
You must be signed in to change notification settings - Fork 0
/
craco.config.js
33 lines (31 loc) · 1.05 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
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const WebpackBar = require('webpackbar');
const CracoAlias = require('craco-alias');
const resolveUrlLoader = require('craco-resolve-url-loader');
// Don't open the browser during development
// process.env.BROWSER = "none";
module.exports = {
webpack: {
plugins: [
new WebpackBar({ profile: true }),
...(process.env.NODE_ENV === 'development'
? [new BundleAnalyzerPlugin({ openAnalyzer: false })]
: []),
],
},
plugins: [
{
plugin: CracoAlias,
options: {
debug: false,
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.extend.json',
},
},
{ plugin: resolveUrlLoader },
],
};