Skip to content

Commit

Permalink
build!: the minimum required Node.js version is 18.12.0 (#4062)
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Jan 27, 2024
1 parent f7977af commit a686879
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 16 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, 20.x]
node-version: [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 @@ -12,7 +12,7 @@
"url": "https://opencollective.com/webpack"
},
"engines": {
"node": ">=14.15.0"
"node": ">=18.12.0"
},
"keywords": [
"webpack",
Expand Down
2 changes: 1 addition & 1 deletion packages/configtest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"types": "lib/index.d.ts",
"license": "MIT",
"engines": {
"node": ">=14.15.0"
"node": ">=18.12.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/generators/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"keywords": [],
"license": "MIT",
"engines": {
"node": ">=14.15.0"
"node": ">=18.12.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/info/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"types": "lib/index.d.ts",
"license": "MIT",
"engines": {
"node": ">=14.15.0"
"node": ">=18.12.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/serve/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"homepage": "https://github.com/webpack/webpack-cli/tree/master/packages/serve",
"license": "MIT",
"engines": {
"node": ">=14.15.0"
"node": ">=18.12.0"
},
"files": [
"lib"
Expand Down
2 changes: 1 addition & 1 deletion packages/webpack-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"main": "./lib/index.js",
"engines": {
"node": ">=14.15.0"
"node": ">=18.12.0"
},
"keywords": [
"webpack",
Expand Down
2 changes: 1 addition & 1 deletion test/build/config-format/babel-commonjs/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"engines": {
"node": ">=14.15.0"
"node": ">=18.12.0"
}
}
2 changes: 1 addition & 1 deletion test/build/config-format/babel-esm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "module",
"engines": {
"node": ">=14.15.0"
"node": ">=18.12.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "module",
"engines": {
"node": ">=14.15.0"
"node": ">=18.12.0"
}
}
2 changes: 1 addition & 1 deletion test/build/config-format/typescript-esnext/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "module",
"engines": {
"node": ">=14.15.0"
"node": ">=18.12.0"
}
}
7 changes: 2 additions & 5 deletions test/build/config-format/typescript-esnext/typescript.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@ const { resolve } = require("path");

describe("webpack cli", () => {
it("should support typescript esnext file", async () => {
const majorNodeVersion = process.version.slice(1, 3);
const env = { ...process.env };

if (majorNodeVersion >= 18) {
// Node.js 20+ change logic, so we need to force esm config loading for test purposes
env.WEBPACK_CLI_FORCE_LOAD_ESM_CONFIG = true;
}
// Node.js 18+ 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: ["--experimental-loader=ts-node/esm"],
Expand Down

0 comments on commit a686879

Please sign in to comment.