From f7c53f70a62cdc10c02f7670b00c0ac12f198b90 Mon Sep 17 00:00:00 2001 From: EGOIST Date: Wed, 25 May 2022 16:31:21 +0800 Subject: [PATCH] feat: update default target to `node14` BREAKING CHANGE: Now tsup requires node 14 or above, the build target is also changed to `node14` by default --- package.json | 3 +++ src/index.ts | 2 +- src/options.ts | 2 +- tsup.config.ts | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 3e4033bf..123744cb 100644 --- a/package.json +++ b/package.json @@ -83,5 +83,8 @@ "@swc/core": { "optional": true } + }, + "engines": { + "node": ">=14" } } diff --git a/src/index.ts b/src/index.ts index 608ba563..e80d9d8d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -64,7 +64,7 @@ const normalizeOptions = async ( ...optionsOverride, } const options: Buildable = { - target: 'node12', + target: 'node14', format: ['cjs'], outDir: 'dist', ..._options, diff --git a/src/options.ts b/src/options.ts index 3e95e707..79727e2a 100644 --- a/src/options.ts +++ b/src/options.ts @@ -43,7 +43,7 @@ export type Options = { /** * Compile target * - * default to `node12` + * default to `node14` */ target?: string | string[] minify?: boolean diff --git a/tsup.config.ts b/tsup.config.ts index 9ef0576f..8513ce33 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -2,7 +2,7 @@ import { defineConfig } from 'tsup' export default defineConfig({ name: 'tsup', - target: 'node12.20.0', + target: 'node14', dts: { resolve: true, // build types for `src/index.ts` only