From 8bb03f8b242bed86026c8c77ee3d7341a7c221c8 Mon Sep 17 00:00:00 2001 From: alex8088 <244096523@qq.com> Date: Fri, 8 Dec 2023 21:35:06 +0800 Subject: [PATCH] feat: bump minimum node version to 18 --- .eslintrc.js | 2 +- package.json | 2 +- src/config.ts | 2 +- tsconfig.json | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 590b814..1f6e5e2 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -8,7 +8,7 @@ module.exports = { parser: '@typescript-eslint/parser', parserOptions: { sourceType: 'module', - ecmaVersion: 2021 + ecmaVersion: 2022 }, plugins: ['@typescript-eslint'], extends: [ diff --git a/package.json b/package.json index 25e8f78..a893403 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "node.d.ts" ], "engines": { - "node": "^14.18.0 || >=16.0.0" + "node": "^18.0.0 || >=20.0.0" }, "packageManager": "pnpm@8.6.10", "author": "Alex Wei", diff --git a/src/config.ts b/src/config.ts index d1e9e2e..29bd9f2 100644 --- a/src/config.ts +++ b/src/config.ts @@ -316,7 +316,7 @@ async function bundleConfigFile(fileName: string, isESM: boolean): Promise<{ cod absWorkingDir: process.cwd(), entryPoints: [fileName], write: false, - target: ['node14.18', 'node16'], + target: ['node18'], platform: 'node', bundle: true, format: isESM ? 'esm' : 'cjs', diff --git a/tsconfig.json b/tsconfig.json index 72b761a..f56ac22 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,13 +1,13 @@ { "compilerOptions": { - "target": "es2019", - "module": "esnext", - "lib": ["esnext"], + "target": "ES2022", + "module": "ESNext", + "lib": ["ESNext"], "sourceMap": false, "strict": true, "allowJs": true, "esModuleInterop": true, - "moduleResolution": "node", + "moduleResolution": "Node", "resolveJsonModule": true, "forceConsistentCasingInFileNames": true, "skipLibCheck": true,