File tree 2 files changed +16
-2
lines changed
2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -259,7 +259,21 @@ module.exports = function (webpackEnv) {
259
259
/* webpack-5-react-scripts end */
260
260
// this defaults to 'window', but by setting it to 'this' then
261
261
// module chunks which are built will work in web workers as well.
262
- globalObject : 'this' ,
262
+ /* webpack-5-react-scripts start */
263
+ // Fix for issue: https://github.com/webpack/webpack/issues/6525#issuecomment-552140798
264
+ // globalObject: 'this',
265
+ globalObject : `(() => {
266
+ if (typeof self !== 'undefined') {
267
+ return self;
268
+ } else if (typeof window !== 'undefined') {
269
+ return window;
270
+ } else if (typeof global !== 'undefined') {
271
+ return global;
272
+ } else {
273
+ return Function('return this')();
274
+ }
275
+ })()` ,
276
+ /* webpack-5-react-scripts end */
263
277
} ,
264
278
optimization : {
265
279
minimize : isEnvProduction ,
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " webpack-5-react-scripts" ,
3
- "version" : " 4.0.2-next.2 " ,
3
+ "version" : " 4.0.2-next.3 " ,
4
4
"description" : " Configuration and scripts for Create React App using Webpack 5." ,
5
5
"repository" : {
6
6
"type" : " git" ,
You can’t perform that action at this time.
0 commit comments