Skip to content

Commit 5c63d34

Browse files
authored
Merge pull request #16 from nextgensparx/fix-chunk-splitting
Fix missing chunks in background and content scripts when in production mode
2 parents 5389f84 + 0356134 commit 5c63d34

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)