File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
packages/react-scripts/config Expand file tree Collapse file tree 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');
3939// @remove -on-eject-end
4040const postcssNormalize = require ( 'postcss-normalize' ) ;
4141
42+ const appPackageJson = require ( paths . appPackageJson ) ;
43+
4244// Source maps are resource heavy and can cause out of memory issue for large source files.
4345const shouldUseSourceMap = process . env . GENERATE_SOURCEMAP !== 'false' ;
4446// 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) {
189191 . replace ( / \\ / g, '/' )
190192 : isEnvDevelopment &&
191193 ( 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 } ` ,
192197 } ,
193198 optimization : {
194199 minimize : isEnvProduction ,
@@ -197,7 +202,7 @@ module.exports = function(webpackEnv) {
197202 new TerserPlugin ( {
198203 terserOptions : {
199204 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
201206 // to apply any minification steps that turns valid ecma 5 code
202207 // into invalid ecma 5 code. This is why the 'compress' and 'output'
203208 // sections only apply transformations that are ecma 5 safe
You can’t perform that action at this time.
0 commit comments