Skip to content

Commit

Permalink
Support any custom globalObject option in Webpack Config. (#352)
Browse files Browse the repository at this point in the history
* Removed left side check to support custom global object which can be any string

* Changelog update

* format
  • Loading branch information
Gongreg committed May 19, 2020
1 parent 757c12e commit 5cf45eb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -17,6 +17,9 @@ _Note: Gaps between patch versions are faulty, broken or test releases._

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

* **Bug Fix**
* Support any custom `globalObject` option in Webpack Config. ([#352](https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/352) by [@Gongreg](https://github.com/Gongreg))

## 3.7.0

* **New Feature**
Expand Down
8 changes: 0 additions & 8 deletions src/parseUtils.js
Expand Up @@ -198,14 +198,6 @@ function isAsyncChunkPushExpression(node) {
callee.type === 'MemberExpression' &&
callee.property.name === 'push' &&
callee.object.type === 'AssignmentExpression' &&
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'
) &&
args.length === 1 &&
args[0].type === 'ArrayExpression' &&
mayBeAsyncChunkArguments(args[0].elements) &&
Expand Down
@@ -0,0 +1 @@
(("undefined" != typeof self ? self : this).webpackJsonp_someCustomName = ("undefined" != typeof self ? self : this).webpackJsonp_someCustomName || []).push([[27],{1:function(e,n,t){console.log("Chuck Norris")}}]);
@@ -0,0 +1,6 @@
{
"modules": {
"1": "function(e,n,t){console.log(\"Chuck Norris\")}"
}
}

0 comments on commit 5cf45eb

Please sign in to comment.