Skip to content

Commit

Permalink
test(@ngtools/webpack): update webpack test-app E2E to use Webpack 5
Browse files Browse the repository at this point in the history
The direct Webpack test for the Webpack plugin is now updated to use Webpack 5 as Webpack 5 is now the default for the Angular tooling.
  • Loading branch information
clydin committed Apr 8, 2021
1 parent 79f369c commit 118ffb1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/legacy-cli/e2e/assets/webpack/test-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"devDependencies": {
"raw-loader": "^4.0.2",
"sass": "^1.32.8",
"sass-loader": "^10.1.1",
"sass-loader": "^11.0.1",
"typescript": "~4.2.3",
"webpack": "^4.46.0",
"webpack": "^5.27.0",
"webpack-cli": "^4.5.0"
}
}
9 changes: 5 additions & 4 deletions tests/legacy-cli/e2e/tests/packages/webpack/test-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ import { createProjectFromAsset } from '../../../utils/assets';
import { expectFileSizeToBeUnder, expectFileToMatch, replaceInFile } from '../../../utils/fs';
import { exec } from '../../../utils/process';


export default async function (skipCleaning: () => void) {
const webpackCLIBin = normalize('node_modules/.bin/webpack-cli');

await createProjectFromAsset('webpack/test-app');

await exec(webpackCLIBin);

// Note: these sizes are without Build Optimizer or any advanced optimizations in the CLI.
await expectFileSizeToBeUnder('dist/app.main.js', 565 * 1024);
await expectFileSizeToBeUnder('dist/1.app.main.js', 1 * 1024);
await expectFileSizeToBeUnder('dist/2.app.main.js', 2 * 1024);
await expectFileSizeToBeUnder('dist/app.main.js', 656 * 1024);
await expectFileSizeToBeUnder('dist/501.app.main.js', 1 * 1024);
await expectFileSizeToBeUnder('dist/888.app.main.js', 2 * 1024);
await expectFileSizeToBeUnder('dist/972.app.main.js', 2 * 1024);


// test resource urls without ./
Expand Down

0 comments on commit 118ffb1

Please sign in to comment.