diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index 62f7b0c41b..f60a1ed06f 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -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,