Skip to content

Commit

Permalink
Merge pull request #323 from lemonmade/fix-self-global-object
Browse files Browse the repository at this point in the history
Allow self for globalObject in async chunks
  • Loading branch information
valscion committed Oct 16, 2019
2 parents f49796f + 2116b66 commit ea074c1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -14,6 +14,9 @@ _Note: Gaps between patch versions are faulty, broken or test releases._

<!-- Add changelog entries for new changes under this section -->

* **Improvement**
* Support webpack builds where `output.globalObject` is set to `'self'` ([#323](https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/323) by [@lemonmade](https://github.com/lemonmade))

## 3.5.2

* **Bug Fix**
Expand Down
2 changes: 2 additions & 0 deletions src/parseUtils.js
Expand Up @@ -185,6 +185,8 @@ function isAsyncChunkPushExpression(node) {
callee.object.left.object &&
(
callee.object.left.object.name === 'window' ||
// `self` is a common output.globalObject value used to support both workers and browsers
callee.object.left.object.name === 'self' ||
// Webpack 4 uses `this` instead of `window`
callee.object.left.object.type === 'ThisExpression'
) &&
Expand Down
@@ -0,0 +1 @@
(self.webpackJsonp=self.webpackJsonp||[]).push([[27],{1:function(e,n,t){console.log("Chuck Norris")}}]);
@@ -0,0 +1,5 @@
{
"modules": {
"1": "function(e,n,t){console.log(\"Chuck Norris\")}"
}
}

0 comments on commit ea074c1

Please sign in to comment.