Add a custom jsonpFunction to prevent collisions with other splitChunks-using projects (https://github.com/woocommerce/woocommerce-blocks/pull/520)

This commit is contained in:
Kelly Dwan 2019-04-08 17:53:06 -04:00 committed by GitHub
parent bc9fcc1a21
commit d826ee9ee9
1 changed files with 5 additions and 0 deletions

View File

@ -52,7 +52,12 @@ const GutenbergBlocksConfig = {
output: {
path: path.resolve( __dirname, './build/' ),
filename: '[name].js',
library: [ 'wc', 'blocks', '[name]' ],
libraryTarget: 'this',
// This fixes an issue with multiple webpack projects using chunking
// overwriting each other's chunk loader function.
// See https://webpack.js.org/configuration/output/#outputjsonpfunction
jsonpFunction: 'webpackWcBlocksJsonp',
},
externals,
optimization: {