From f5a348113683003834d33a996bc29aaa4079eb6d Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Fri, 23 Sep 2022 15:25:47 +0800 Subject: [PATCH] fix(esbuild): transpile with esnext in dev (#10207) --- packages/plugin-vue/src/main.ts | 6 +++++- playground/vue/tsconfig.json | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 playground/vue/tsconfig.json diff --git a/packages/plugin-vue/src/main.ts b/packages/plugin-vue/src/main.ts index bdb846ab..5d76256f 100644 --- a/packages/plugin-vue/src/main.ts +++ b/packages/plugin-vue/src/main.ts @@ -221,7 +221,11 @@ export async function transformMain( const { code, map } = await transformWithEsbuild( resolvedCode, filename, - { loader: 'ts', sourcemap: options.sourceMap }, + { + loader: 'ts', + target: 'esnext', + sourcemap: options.sourceMap + }, resolvedMap ) resolvedCode = code diff --git a/playground/vue/tsconfig.json b/playground/vue/tsconfig.json new file mode 100644 index 00000000..5f90cb16 --- /dev/null +++ b/playground/vue/tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + // esbuild transpile should ignore this + "target": "ES5" + }, + "include": ["src"] +}