From d1e2d5a5a11ecf26c1160448abbd38f03697dd2d Mon Sep 17 00:00:00 2001 From: ryoppippi <1560508+ryoppippi@users.noreply.github.com> Date: Mon, 10 Jun 2024 21:08:46 +0100 Subject: [PATCH] feat: allow custom TypeScript target This change allows the TypeScript compiler target to be customized. If no target is specified, it defaults to ES2020. This provides more flexibility for users who may want to target different JavaScript versions. --- packages/unplugin-typia/src/core/typia.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/unplugin-typia/src/core/typia.ts b/packages/unplugin-typia/src/core/typia.ts index 2617f177..651d9ae3 100644 --- a/packages/unplugin-typia/src/core/typia.ts +++ b/packages/unplugin-typia/src/core/typia.ts @@ -94,7 +94,7 @@ async function getProgramAndSource( const tsSource = ts.createSourceFile( id, source, - ts.ScriptTarget.ES2020, + compilerOptions.target ?? ts.ScriptTarget.ES2020, ); const host = ts.createCompilerHost(compilerOptions);