Skip to content

Commit d5ea122

Browse files
Kent C. Doddsjoeycozza
Kent C. Dodds
authored andcommitted
set output.globalObject to 'this' (facebook#7742)
Closes facebook#7741
1 parent 05dcd79 commit d5ea122

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/react-scripts/config/webpack.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ module.exports = function(webpackEnv) {
202202
// Prevents conflicts when multiple Webpack runtimes (from different apps)
203203
// are used on the same page.
204204
jsonpFunction: `webpackJsonp${appPackageJson.name}`,
205+
// this defaults to 'window', but by setting it to 'this' then
206+
// module chunks which are built will work in web workers as well.
207+
globalObject: 'this',
205208
},
206209
optimization: {
207210
minimize: isEnvProduction,

0 commit comments

Comments
 (0)