Skip to content

Commit

Permalink
Fixed handling of WebPack chunks again
Browse files Browse the repository at this point in the history
  • Loading branch information
palant committed Jan 3, 2024
1 parent 3d4ea31 commit 4f412ac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/bundles.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,22 @@ export function* parseModules(ast)
`,
// Code splitting
`
statement0_optional;
(placeholder1.placeholder2 = placeholder1.placeholder2 || []).push([
[expression0_literal_repeatable],
expression1
]);
statement2_repeatable_optional;
`,
`
statement0_optional;
"use strict";
(placeholder1.placeholder2 = placeholder1.placeholder2 || []).push([
[expression0_literal_repeatable],
expression1
]);
statement2_repeatable_optional;
`,
`
"use strict";
(placeholder1.placeholder2 = placeholder1.placeholder2 || []).push([
[expression0_literal_repeatable],
expression1,
Expand Down
1 change: 1 addition & 0 deletions test/bundles.js
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@ describe("bundles.parseModules()", () =>
it("should recognize JSONP chunks with additional parameter", () =>
{
let ast = parseScript(`
"use strict";
(window.webpackJsonp = window.webpackJsonp || []).push([
["abc", "cda"],
{
Expand Down

0 comments on commit 4f412ac

Please sign in to comment.