Skip to content

Commit bfd8aab

Browse files
hai-xvalscion
andauthored
fix: failed to parse bundle with IIFE (#685)
* fix: failed to parse bundle with IIFE * test * Add CHANGELOG entry --------- Co-authored-by: Vesa Laakso <[email protected]>
1 parent 241fe8c commit bfd8aab

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ _Note: Gaps between patch versions are faulty, broken or test releases._
1414

1515
* **Bug Fix**
1616
* Fix tooltip styling in dark mode when using CSS Modules ([#688](https://github.com/webpack/webpack-bundle-analyzer/pull/688) by [@theEquinoxDev](https://github.com/theEquinoxDev))
17-
17+
* Avoid parse failures for bundles with IIFE ([#685](https://github.com/webpack/webpack-bundle-analyzer/pull/685) by [@hai-x](https://github.com/hai-x))
1818

1919
## 5.1.0
2020

src/parseUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function parseBundle(bundlePath, opts) {
5353

5454
if (firstVariableDeclaration) {
5555
for (const declaration of firstVariableDeclaration.declarations) {
56-
if (declaration.init) {
56+
if (declaration.init && isModulesList(declaration.init)) {
5757
state.locations = getModulesLocations(declaration.init);
5858

5959
if (state.locations) {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(()=>{const e=console.log("foo");})();
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"modules": {}
3+
}

0 commit comments

Comments
 (0)