File tree 2 files changed +6
-4
lines changed
packages/angular_devkit/build_angular/src/tools/esbuild
tests/legacy-cli/e2e/tests/basic
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -251,6 +251,7 @@ function getEsBuildCommonOptions(options: NormalizedApplicationBuildOptions): Bu
251
251
outExtension : outExtension ? { '.js' : `.${ outExtension } ` } : undefined ,
252
252
sourcemap : sourcemapOptions . scripts && ( sourcemapOptions . hidden ? 'external' : true ) ,
253
253
splitting : true ,
254
+ chunkNames : 'chunk-[hash]' ,
254
255
tsconfig,
255
256
external : externalDependencies ,
256
257
write : false ,
Original file line number Diff line number Diff line change 1
- import { waitForAnyProcessOutputToMatch , silentNg } from '../../utils/process' ;
2
- import { writeFile , writeMultipleFiles } from '../../utils/fs' ;
3
1
import fetch from 'node-fetch' ;
4
- import { ngServe } from '../../utils/project' ;
5
2
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' ;
6
6
7
7
export default async function ( ) {
8
8
const esbuild = getGlobalVariable ( 'argv' ) [ 'esbuild' ] ;
9
9
const validBundleRegEx = esbuild ? / c o m p l e t e \. / : / C o m p i l e d s u c c e s s f u l l y \. / ;
10
- const lazyBundleRegEx = esbuild ? / l a z y \. m o d u l e / : / l a z y _ m o d u l e _ t s \. j s / ;
10
+ const lazyBundleRegEx = esbuild ? / c h u n k - / : / l a z y _ m o d u l e _ t s \. j s / ;
11
11
12
12
const port = await ngServe ( ) ;
13
13
// Add a lazy module.
@@ -17,6 +17,7 @@ export default async function () {
17
17
// We need to use Promise.all to ensure we are waiting for the rebuild just before we write
18
18
// the file, otherwise rebuilds can be too fast and fail CI.
19
19
// Count the bundles.
20
+ // Verify that a new chunk was created.
20
21
await Promise . all ( [
21
22
waitForAnyProcessOutputToMatch ( lazyBundleRegEx ) ,
22
23
writeFile (
You can’t perform that action at this time.
0 commit comments