-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcraco.config.js
46 lines (46 loc) · 1.18 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
41
42
43
44
45
46
const { when } = require('@craco/craco')
const CracoLessPlugin = require('craco-less')
const TerserPlugin = require('terser-webpack-plugin')
module.exports = {
plugins: [
{
plugin: CracoLessPlugin,
options: {
lessLoaderOptions: {
lessOptions: {
// config less variable here
modifyVars: {
'@primary-color': '#18BB97',
'@link-color': '#0fcd8c',
'@logo-color': '#39E1A4',
},
javascriptEnabled: true,
},
},
},
},
],
webpack: {
plugins: [
...when(
process.env.NETWORK === 'main',
() => [
new TerserPlugin({
sourceMap: true, // Must be set to true if using source-maps in production
terserOptions: {
ecma: undefined,
warnings: false,
parse: {},
compress: {
drop_console: process.env.NODE_ENV === 'production',
drop_debugger: true,
pure_funcs: process.env.NODE_ENV === 'production' ? ['console.log'] : '',
},
},
}),
],
[]
),
],
},
}