Skip to content

Commit 50b65e2

Browse files
fixup! implement webpack chunks file updating using ast manipulation
introduce `functionUsesChunkInstallationVariables` to make code clearer
1 parent 12d1ed8 commit 50b65e2

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

builder/src/build/patches/investigated/update-webpack-chunks-file/get-file-content-with-updated-webpack-f-require-code.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@ export async function getFileContentWithUpdatedWebpackFRequireCode(
1717
const binaryExpressionRight = binaryExpression.getRight();
1818
const binaryExpressionRightText = binaryExpressionRight.getText();
1919

20-
if (
21-
!binaryExpressionRightText.includes(installChunk) ||
22-
!binaryExpressionRightText.includes(installedChunks)
23-
)
24-
return;
20+
const functionUsesChunkInstallationVariables =
21+
binaryExpressionRightText.includes(installChunk) &&
22+
binaryExpressionRightText.includes(installedChunks);
23+
if (!functionUsesChunkInstallationVariables) return;
2524

2625
if (!binaryExpressionRight.isKind(ts.SyntaxKind.ArrowFunction)) return;
2726

0 commit comments

Comments
 (0)