-
Notifications
You must be signed in to change notification settings - Fork 0
/
craco.config.js
59 lines (57 loc) · 1.41 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
47
48
49
50
51
52
53
54
55
56
57
58
59
const {ESLINT_MODES } = require("@craco/craco");
const CracoLessPlugin = require('craco-less');
const CracoAlias = require("craco-alias");
const OpenBrowserPlugin = require("open-browser-webpack-plugin");
const TerserPlugin = require('terser-webpack-plugin');
module.exports = {
reactScriptsVersion: "react-scripts",
plugins: [
{
plugin: CracoLessPlugin,
options: {
lessLoaderOptions: {
lessOptions: {
modifyVars: {
"@primary-color": "#1DA57A",
"@border-radius-base": "10px",
"@font-family": "'NanumSquareRound', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif"
},
javascriptEnabled: true,
},
},
},
},
{
plugin: CracoAlias,
options: {
// see in examples section
baseUrl: "./src",
source: "tsconfig",
tsConfigPath: "tsconfig.paths.json",
},
},
{ plugin: new OpenBrowserPlugin({ url: "http://localhost:3000" }) },
],
webpack: {
configure: (webpackConfig) => {
webpackConfig.optimization.minimizer = [
new TerserPlugin({
cache: true,
parallel: true,
sourceMap: true, // Must be set to true if using source-maps in production
terserOptions: {
compress: {
drop_console: true,
},
},
}),
];
return webpackConfig;
},
plugins: [
],
},
eslint: {
mode: ESLINT_MODES.file,
},
};