Skip to content

Commit

Permalink
set output.globalObject to 'this' (#7742)
Browse files Browse the repository at this point in the history
Closes #7741
  • Loading branch information
Kent C. Dodds authored and iansu committed Sep 26, 2019
1 parent 0d1775e commit 42ee721
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/react-scripts/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ module.exports = function(webpackEnv) {
// Prevents conflicts when multiple Webpack runtimes (from different apps)
// are used on the same page.
jsonpFunction: `webpackJsonp${appPackageJson.name}`,
// this defaults to 'window', but by setting it to 'this' then
// module chunks which are built will work in web workers as well.
globalObject: 'this',
},
optimization: {
minimize: isEnvProduction,
Expand Down

0 comments on commit 42ee721

Please sign in to comment.