Skip to content

Commit aae6c90

Browse files
clydinalan-agius4
authored andcommitted
test: support Webpack 5 in deployUrl E2E test
The public path will not be stored in the Webpack runtime chunk in Webpack 5 unless the public path is used by the application. A lazy import is added to the test to ensure that the public path is used.
1 parent 9087197 commit aae6c90

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/legacy-cli/e2e/tests/build/deploy-url.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import { ng } from '../../utils/process';
22
import { copyProjectAsset } from '../../utils/assets';
3-
import { expectFileToMatch, writeMultipleFiles } from '../../utils/fs';
3+
import { appendToFile, expectFileToMatch, writeMultipleFiles } from '../../utils/fs';
44

55
export default function () {
66
return Promise.resolve()
77
.then(() => writeMultipleFiles({
88
'src/styles.css': 'div { background: url("./assets/more.png"); }',
9+
'src/lazy.ts': 'export const lazy = "lazy";',
910
}))
11+
.then(() => appendToFile('src/main.ts', 'import("./lazy");'))
1012
// use image with file size >10KB to prevent inlining
1113
.then(() => copyProjectAsset('images/spectrum.png', './src/assets/more.png'))
1214
.then(() => ng('build', '--deploy-url=deployUrl/', '--extract-css'))

0 commit comments

Comments
 (0)