Skip to content

Commit

Permalink
ci: add Node.js v20 (#3739)
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 authored Jun 1, 2023
1 parent 79b0f31 commit 1e9e946
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [14.x, 16.x, 18.x, 19.x]
node-version: [14.x, 16.x, 18.x, 20.x]
shard: ["1/4", "2/4", "3/4", "4/4"]
webpack-version: [latest]
dev-server-version: [latest]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"style-loader": "^3.3.1",
"ts-jest": "^29.0.1",
"ts-loader": "^9.3.1",
"ts-node": "^10.8.0",
"ts-node": "^10.9.1",
"typescript": "^5.0.4",
"webpack": "^5.72.0",
"webpack-bundle-analyzer": "^4.5.0",
Expand Down
5 changes: 4 additions & 1 deletion test/build/config-format/typescript-esnext/package.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"type": "module"
"type": "module",
"engines": {
"node": ">=14.15.0"
}
}
11 changes: 10 additions & 1 deletion test/build/config-format/typescript-esnext/typescript.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,18 @@ describe("webpack cli", () => {
return;
}

const env = { ...process.env };

if (majorNodeVersion >= 20) {
// Node.js 20+ change logic, so we need to force esm config loading for test purposes
env.WEBPACK_CLI_FORCE_LOAD_ESM_CONFIG = true;
}

const { exitCode, stderr, stdout } = await run(__dirname, ["-c", "./webpack.config.ts"], {
nodeOptions: ["--loader=ts-node/esm"],
nodeOptions: ["--experimental-loader=ts-node/esm"],
env,
});

expect(stderr).not.toBeFalsy(); // Deprecation warning logs on stderr
expect(stdout).toBeTruthy();
expect(exitCode).toBe(0);
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9700,7 +9700,7 @@ ts-loader@^9.3.1:
micromatch "^4.0.0"
semver "^7.3.4"

ts-node@^10.8.0, ts-node@^10.8.1:
ts-node@^10.8.1, ts-node@^10.9.1:
version "10.9.1"
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b"
integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==
Expand Down

0 comments on commit 1e9e946

Please sign in to comment.