From 45832d999e50e68e299bdc9eee99cde9d8a18bba Mon Sep 17 00:00:00 2001 From: EGOIST Date: Fri, 16 Jun 2023 13:55:41 +0800 Subject: [PATCH] feat: require nodejs 16 or above BREAKING CHANGE: require nodejs 16 or above --- .github/workflows/ci.yml | 2 +- package.json | 2 +- src/index.ts | 9 +++------ src/options.ts | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4830e56..74f97301 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - node-version: [14.x, 16.x] + node-version: [16.x, 18.x] runs-on: ${{ matrix.os }} diff --git a/package.json b/package.json index 2ee939e7..d94abb25 100644 --- a/package.json +++ b/package.json @@ -88,6 +88,6 @@ } }, "engines": { - "node": ">=14.18" + "node": ">=16.14" } } diff --git a/src/index.ts b/src/index.ts index 64e062d2..270d6551 100644 --- a/src/index.ts +++ b/src/index.ts @@ -122,7 +122,7 @@ const normalizeOptions = async ( } if (!options.target) { - options.target = 'node14' + options.target = 'node16' } return options as NormalizedOptions @@ -238,12 +238,9 @@ export async function build(_options: Options) { // .d.ts files are removed in the `dtsTask` instead // `dtsTask` is a separate process, which might start before `mainTasks` if (options.dts) { - extraPatterns.unshift('!**/*.d.ts'); + extraPatterns.unshift('!**/*.d.ts') } - await removeFiles( - ['**/*', ...extraPatterns], - options.outDir - ) + await removeFiles(['**/*', ...extraPatterns], options.outDir) logger.info('CLI', 'Cleaning output folder') } diff --git a/src/options.ts b/src/options.ts index fc3c2afa..20217dbc 100644 --- a/src/options.ts +++ b/src/options.ts @@ -97,7 +97,7 @@ export type Options = { /** * Compile target * - * default to `node14` + * default to `node16` */ target?: Target | Target[] minify?: boolean | 'terser'