Skip to content

Commit 2c1a45c

Browse files
authored
feat!: bump minimum node version to 18 (#14030)
1 parent 63a4451 commit 2c1a45c

19 files changed

Lines changed: 27 additions & 30 deletions

File tree

.eslintrc.cjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// @ts-check
22
const { builtinModules } = require('node:module')
33
const { defineConfig } = require('eslint-define-config')
4+
const pkg = require('./package.json')
45

56
module.exports = defineConfig({
67
root: true,
@@ -16,7 +17,7 @@ module.exports = defineConfig({
1617
parser: '@typescript-eslint/parser',
1718
parserOptions: {
1819
sourceType: 'module',
19-
ecmaVersion: 2021,
20+
ecmaVersion: 2022,
2021
},
2122
rules: {
2223
eqeqeq: ['warn', 'always', { null: 'never' }],
@@ -173,13 +174,13 @@ module.exports = defineConfig({
173174
'n/no-unsupported-features/es-builtins': [
174175
'error',
175176
{
176-
version: '^14.18.0 || >=16.0.0',
177+
version: pkg.engines.node,
177178
},
178179
],
179180
'n/no-unsupported-features/node-builtins': [
180181
'error',
181182
{
182-
version: '^14.18.0 || >=16.0.0',
183+
version: pkg.engines.node,
183184
},
184185
],
185186
'@typescript-eslint/explicit-module-boundary-types': 'off',

.github/workflows/ci.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
strategy:
4040
matrix:
4141
os: [ubuntu-latest]
42-
node_version: [14, 16, 18, 20]
42+
node_version: [18, 20]
4343
include:
4444
# Active LTS + other OS
4545
- os: macos-latest
@@ -67,14 +67,8 @@ jobs:
6767
packages/create-vite/template**
6868
**.md
6969
70-
- name: Install pnpm (node 14, pnpm 7)
71-
if: steps.changed-files.outputs.only_changed != 'true' && matrix.node_version == 14
72-
uses: pnpm/action-setup@v2.4.0
73-
with:
74-
version: 7
75-
7670
- name: Install pnpm
77-
if: steps.changed-files.outputs.only_changed != 'true' && matrix.node_version != 14
71+
if: steps.changed-files.outputs.only_changed != 'true'
7872
uses: pnpm/action-setup@v2.4.0
7973

8074
- name: Set node version to ${{ matrix.node_version }}

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
- name: Install pnpm
2424
uses: pnpm/action-setup@v2.4.0
2525

26-
- name: Set node version to 16.x
26+
- name: Set node version to 18
2727
uses: actions/setup-node@v3
2828
with:
29-
node-version: 16.x
29+
node-version: 18
3030
registry-url: https://registry.npmjs.org/
3131
cache: "pnpm"
3232

docs/guide/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ The supported template presets are:
4242
## Scaffolding Your First Vite Project
4343

4444
::: tip Compatibility Note
45-
Vite requires [Node.js](https://nodejs.org/en/) version 14.18+, 16+. However, some templates require a higher Node.js version to work, please upgrade if your package manager warns about it.
45+
Vite requires [Node.js](https://nodejs.org/en/) version 18+. 20+. However, some templates require a higher Node.js version to work, please upgrade if your package manager warns about it.
4646
:::
4747

4848
::: code-group

netlify.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build.environment]
2-
NODE_VERSION = "16"
2+
NODE_VERSION = "18"
33
# don't need playwright for docs build
44
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = "1"
55
[build]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"private": true,
44
"type": "module",
55
"engines": {
6-
"node": "^14.18.0 || >=16.0.0"
6+
"node": "^18.0.0 || >=20.0.0"
77
},
88
"homepage": "https://vitejs.dev/",
99
"repository": {

packages/create-vite/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Scaffolding Your First Vite Project
44

55
> **Compatibility Note:**
6-
> Vite requires [Node.js](https://nodejs.org/en/) version 14.18+, 16+. However, some templates require a higher Node.js version to work, please upgrade if your package manager warns about it.
6+
> Vite requires [Node.js](https://nodejs.org/en/) version 18+, 20+. However, some templates require a higher Node.js version to work, please upgrade if your package manager warns about it.
77
88
With NPM:
99

packages/create-vite/build.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ export default defineBuildConfig({
1111
rollup: {
1212
inlineDependencies: true,
1313
esbuild: {
14+
target: 'node18',
1415
minify: true,
1516
},
1617
},
1718
alias: {
18-
// we can always use non-transpiled code since we support 14.18.0+
19+
// we can always use non-transpiled code since we support node 18+
1920
prompts: 'prompts/lib/index.js',
2021
},
2122
hooks: {

packages/create-vite/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"prepublishOnly": "npm run build"
2121
},
2222
"engines": {
23-
"node": "^14.18.0 || >=16.0.0"
23+
"node": "^18.0.0 || >=20.0.0"
2424
},
2525
"repository": {
2626
"type": "git",

packages/create-vite/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"include": ["build.config.ts", "src", "__tests__"],
33
"compilerOptions": {
44
"outDir": "dist",
5-
"target": "ES2020",
5+
"target": "ES2022",
66
"module": "ES2020",
77
"moduleResolution": "bundler",
88
"strict": true,

0 commit comments

Comments
 (0)