Skip to content

Commit 2116b66

Browse files
committed
Allow self for globalObject in async chunks
Update changelog
1 parent f49796f commit 2116b66

4 files changed

+11
-0
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ _Note: Gaps between patch versions are faulty, broken or test releases._
1414

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

17+
* **Improvement**
18+
* 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))
19+
1720
## 3.5.2
1821

1922
* **Bug Fix**

src/parseUtils.js

+2
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ function isAsyncChunkPushExpression(node) {
185185
callee.object.left.object &&
186186
(
187187
callee.object.left.object.name === 'window' ||
188+
// `self` is a common output.globalObject value used to support both workers and browsers
189+
callee.object.left.object.name === 'self' ||
188190
// Webpack 4 uses `this` instead of `window`
189191
callee.object.left.object.type === 'ThisExpression'
190192
) &&
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(self.webpackJsonp=self.webpackJsonp||[]).push([[27],{1:function(e,n,t){console.log("Chuck Norris")}}]);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"modules": {
3+
"1": "function(e,n,t){console.log(\"Chuck Norris\")}"
4+
}
5+
}

0 commit comments

Comments
 (0)