diff --git a/plugins/woocommerce-blocks/webpack.config.js b/plugins/woocommerce-blocks/webpack.config.js index 68268e22d71..1b4856262dc 100644 --- a/plugins/woocommerce-blocks/webpack.config.js +++ b/plugins/woocommerce-blocks/webpack.config.js @@ -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: {