-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcraco.config.js
45 lines (42 loc) · 1.23 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
// const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
webpack: {
configure: (webpackConfig, { env, paths }) => {
// if (env !== 'development') {
// const htmlWebpackPluginInstance = webpackConfig.plugins.find(
// webpackPlugin => webpackPlugin instanceof HtmlWebpackPlugin,
// )
// if (htmlWebpackPluginInstance) {
// htmlWebpackPluginInstance.options.inject = false
// }
// }
const mcep = webpackConfig.plugins.find(p => {
return p.constructor.name === 'MiniCssExtractPlugin'
})
if (mcep) {
mcep.options.filename = 'static/css/[name].css'
}
return {
...webpackConfig,
entry: {
main: './src/index.tsx',
aws_cs: './src/content_scripts/aws.ts',
lightlytics_cs: './src/content_scripts/lightlytics.tsx',
tooltips_cs: './src/content_scripts/tooltips.tsx',
},
output: {
...webpackConfig.output,
filename: 'static/js/[name].js',
},
optimization: {
splitChunks: {
chunks() {
return false
},
},
runtimeChunk: false,
},
}
},
},
}