Skip to content

Commit 5048f6e

Browse files
gultyayevclydin
authored andcommitted
fix(@angular-devkit/build-angular): Set chunk names explicitly
Explicitly set chunk name pattern to exclude them from Jest run
1 parent 5908ede commit 5048f6e

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Diff for: packages/angular_devkit/build_angular/src/tools/esbuild/application-code-bundle.ts

+1
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ function getEsBuildCommonOptions(options: NormalizedApplicationBuildOptions): Bu
251251
outExtension: outExtension ? { '.js': `.${outExtension}` } : undefined,
252252
sourcemap: sourcemapOptions.scripts && (sourcemapOptions.hidden ? 'external' : true),
253253
splitting: true,
254+
chunkNames: 'chunk-[hash]',
254255
tsconfig,
255256
external: externalDependencies,
256257
write: false,

Diff for: tests/legacy-cli/e2e/tests/basic/rebuild.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { waitForAnyProcessOutputToMatch, silentNg } from '../../utils/process';
2-
import { writeFile, writeMultipleFiles } from '../../utils/fs';
31
import fetch from 'node-fetch';
4-
import { ngServe } from '../../utils/project';
52
import { getGlobalVariable } from '../../utils/env';
3+
import { writeFile, writeMultipleFiles } from '../../utils/fs';
4+
import { silentNg, waitForAnyProcessOutputToMatch } from '../../utils/process';
5+
import { ngServe } from '../../utils/project';
66

77
export default async function () {
88
const esbuild = getGlobalVariable('argv')['esbuild'];
99
const validBundleRegEx = esbuild ? /complete\./ : /Compiled successfully\./;
10-
const lazyBundleRegEx = esbuild ? /lazy\.module/ : /lazy_module_ts\.js/;
10+
const lazyBundleRegEx = esbuild ? /chunk-/ : /lazy_module_ts\.js/;
1111

1212
const port = await ngServe();
1313
// Add a lazy module.
@@ -17,6 +17,7 @@ export default async function () {
1717
// We need to use Promise.all to ensure we are waiting for the rebuild just before we write
1818
// the file, otherwise rebuilds can be too fast and fail CI.
1919
// Count the bundles.
20+
// Verify that a new chunk was created.
2021
await Promise.all([
2122
waitForAnyProcessOutputToMatch(lazyBundleRegEx),
2223
writeFile(

0 commit comments

Comments
 (0)