Skip to content

Commit 42ee721

Browse files
Kent C. Doddsiansu
Kent C. Dodds
authored andcommitted
set output.globalObject to 'this' (#7742)
Closes #7741
1 parent 0d1775e commit 42ee721

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)