Skip to content

Commit 0356134

Browse files
committed
Disable code splitting
This fixes missing chunks in background and content scripts since they don't have corresponding HTML files to load the split chunks.
1 parent 5389f84 commit 0356134

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module.exports = (api, options) => {
2222
const hasKeyFile = fs.existsSync(keyFile)
2323

2424
api.chainWebpack((webpackConfig) => {
25-
const config = webpackConfig.entryPoints.delete('app').end()
25+
webpackConfig.entryPoints.delete('app')
2626
const entry = {}
2727
if (pluginOptions.components.background) {
2828
entry['background'] = [api.resolve(componentOptions.background.entry)]
@@ -37,7 +37,8 @@ module.exports = (api, options) => {
3737
entry[name] = paths.map(path => api.resolve(path))
3838
}
3939
}
40-
config.merge({entry})
40+
webpackConfig.merge({entry})
41+
webpackConfig.optimization.delete('splitChunks')
4142
})
4243

4344
api.configureWebpack((webpackConfig) => {

0 commit comments

Comments
 (0)