Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit 24d20a0

Browse files
authored
Add a custom jsonpFunction to prevent collisions with other splitChunks-using projects (#520)
1 parent 0e20915 commit 24d20a0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

webpack.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@ const GutenbergBlocksConfig = {
5252
output: {
5353
path: path.resolve( __dirname, './build/' ),
5454
filename: '[name].js',
55+
library: [ 'wc', 'blocks', '[name]' ],
5556
libraryTarget: 'this',
57+
// This fixes an issue with multiple webpack projects using chunking
58+
// overwriting each other's chunk loader function.
59+
// See https://webpack.js.org/configuration/output/#outputjsonpfunction
60+
jsonpFunction: 'webpackWcBlocksJsonp',
5661
},
5762
externals,
5863
optimization: {

0 commit comments

Comments
 (0)