-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcraco.config.js
51 lines (49 loc) · 1.13 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
const CracoLessPlugin = require('craco-less')
const {
when,
whenDev,
whenProd,
whenCI,
whenTest,
ESLINT_MODES,
POSTCSS_MODES,
} = require('@craco/craco')
const path = require('path')
module.exports = {
reactScriptsVersion: 'react-scripts',
eslint: {
enable: false,
},
typescript: {
enableTypeChecking: false /* (default value) */,
},
webpack: {
alias: {
'@': path.resolve(__dirname, 'src'),
},
configure: {
// output: {
// path: path.resolve(__dirname, "dist")
// },
//这段代码在2020-08-06的时候仅仅修改public文件的打包目录
},
configure: (webpackConfig, { env, paths }) => {
webpackConfig.output.path = path.resolve(__dirname, 'dist') //ts和less编译后的文件
paths.appBuild = path.resolve(__dirname, 'dist') //public中的文件
return webpackConfig
},
},
plugins: [
{
plugin: CracoLessPlugin,
options: {
lessLoaderOptions: {
lessOptions: {
// modifyVars: { '@primary-color': '#1DA57A' },
javascriptEnabled: true,
},
},
},
},
],
}