make sure the donate-button-v2.js never splits and include the runtimeChunk

This commit is contained in:
Eric Schultz 2019-11-14 13:50:51 -06:00 committed by Eric Schultz
parent 87c15f0a0b
commit ab8d25dec2
2 changed files with 18 additions and 1 deletions

View file

@ -1,5 +1,22 @@
process.env.NODE_ENV = process.env.NODE_ENV || 'production'
const environment = require('./environment')
environment.splitChunks()
environment.splitChunks((config) => {
const excludeDonateButtonFromSplit = {
optimization:
{
splitChunks:
{
chunks(chunk) {
// donate-button-v2 can never be split. So don't
return chunk.name !== 'donate-button-v2'
}
},
// we can't have the donate-button-v2 ONLY include runtimeChunk
// so we never split it out. 🙁
runtimeChunk: false
},
}
return Object.assign({}, config, excludeDonateButtonFromSplit)
})
module.exports = environment.toWebpackConfig()