-
Notifications
You must be signed in to change notification settings - Fork 0
/
craco.config.js
55 lines (52 loc) · 1.61 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
/* craco.config.js */
const CracoLessPlugin = require('craco-less');
const path = require('path');
module.exports = {
reactScriptsVersion: 'react-scripts' /* (default value) */,
webpack: {
alias: {
'@': path.resolve(__dirname, 'src'),
// '@components': path.resolve(__dirname, 'src/components'),
// '@pages': path.resolve(__dirname, 'src/pages'),
// '@utils': path.resolve(__dirname, 'src/utils')
},
configure: {
module: {
rules: [
{
test: /\.(png|jp?eg|gif)$/i,
type: 'asset',
generator: {
filename: 'images/[name][ext]',
},
parser: {
dataUrlCondition: {
maxSize: 10 * 1024,
},
},
},
],
},
},
configure: config => {
config.output.publicPath = '/bai-chem-portal/';
config.devtool = config.mode === 'development' ? 'cheap-module-source-map' : false;
return config;
},
},
plugins: [
{
plugin: CracoLessPlugin,
options: {
lessLoaderOptions: {
lessOptions: {
// modifyVars: { '@primary-color': '#1DA57A' },
javascriptEnabled: true,
},
},
},
},
],
devServer: {
},
};