-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
craco.config.cjs
44 lines (41 loc) · 880 Bytes
/
craco.config.cjs
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
// eslint-disable-next-line @typescript-eslint/no-var-requires
const pkg = require('./package.json')
process.env.REACT_APP_VERSION = pkg.version
/**
* @type {import('@craco/types').CracoConfig}
*/
const config = {
eslint: {
enable: true,
mode: 'file',
},
style: {
postcss: {
mode: 'file',
},
},
webpack: {
alias: {
'@': `${__dirname}/src`,
},
configure: (webpackConfig) => {
if (
process.env.NODE_ENV === 'production' &&
process.env.REACT_APP_RUN_IN_SURGE === 'true'
) {
webpackConfig.devtool = false
}
return webpackConfig
},
},
babel: {
plugins: ['babel-plugin-macros', '@emotion/babel-plugin'],
presets: [
[
'@babel/preset-react',
{ runtime: 'automatic', importSource: '@emotion/react' },
],
],
},
}
module.exports = config