File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,8 @@ const getCacheIdentifier = require('react-dev-utils/getCacheIdentifier');
39
39
// @remove -on-eject-end
40
40
const postcssNormalize = require ( 'postcss-normalize' ) ;
41
41
42
+ const appPackageJson = require ( paths . appPackageJson ) ;
43
+
42
44
// Source maps are resource heavy and can cause out of memory issue for large source files.
43
45
const shouldUseSourceMap = process . env . GENERATE_SOURCEMAP !== 'false' ;
44
46
// Some apps do not need the benefits of saving a web request, so not inlining the chunk
@@ -189,6 +191,9 @@ module.exports = function(webpackEnv) {
189
191
. replace ( / \\ / g, '/' )
190
192
: isEnvDevelopment &&
191
193
( info => path . resolve ( info . absoluteResourcePath ) . replace ( / \\ / g, '/' ) ) ,
194
+ // Prevents conflicts when multiple Webpack runtimes (from different apps)
195
+ // are used on the same page.
196
+ jsonpFunction : `webpackJsonp${ appPackageJson . name } ` ,
192
197
} ,
193
198
optimization : {
194
199
minimize : isEnvProduction ,
@@ -197,7 +202,7 @@ module.exports = function(webpackEnv) {
197
202
new TerserPlugin ( {
198
203
terserOptions : {
199
204
parse : {
200
- // we want terser to parse ecma 8 code. However, we don't want it
205
+ // We want terser to parse ecma 8 code. However, we don't want it
201
206
// to apply any minification steps that turns valid ecma 5 code
202
207
// into invalid ecma 5 code. This is why the 'compress' and 'output'
203
208
// sections only apply transformations that are ecma 5 safe
You can’t perform that action at this time.
0 commit comments