Skip to content

Commit

Permalink
4.0.2-next.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Galloway committed Feb 24, 2021
1 parent 0f530f5 commit cf830e6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 15 additions & 1 deletion packages/react-scripts/config/webpack.config.js
Expand Up @@ -259,7 +259,21 @@ module.exports = function (webpackEnv) {
/* webpack-5-react-scripts end */
// 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',
/* webpack-5-react-scripts start */
// Fix for issue: https://github.com/webpack/webpack/issues/6525#issuecomment-552140798
// globalObject: 'this',
globalObject: `(() => {
if (typeof self !== 'undefined') {
return self;
} else if (typeof window !== 'undefined') {
return window;
} else if (typeof global !== 'undefined') {
return global;
} else {
return Function('return this')();
}
})()`,
/* webpack-5-react-scripts end */
},
optimization: {
minimize: isEnvProduction,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-scripts/package.json
@@ -1,6 +1,6 @@
{
"name": "webpack-5-react-scripts",
"version": "4.0.2-next.2",
"version": "4.0.2-next.3",
"description": "Configuration and scripts for Create React App using Webpack 5.",
"repository": {
"type": "git",
Expand Down

0 comments on commit cf830e6

Please sign in to comment.