Skip to content

Commit

Permalink
fix: simplify meta lang
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed May 3, 2022
1 parent 0856fb2 commit 2a0b948
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions packages/plugin-vue/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,12 @@ export async function transformMain(
}

// handle TS transpilation
const isTs =
let resolvedCode = output.join('\n')
if (
(descriptor.script?.lang === 'ts' ||
descriptor.scriptSetup?.lang === 'ts') &&
!descriptor.script?.src // only normal script can have src

let resolvedCode = output.join('\n')
if (isTs) {
) {
const { code, map } = await transformWithEsbuild(
resolvedCode,
filename,
Expand All @@ -216,9 +215,7 @@ export async function transformMain(
},
meta: {
vite: {
lang: isTs
? 'ts'
: descriptor.scriptSetup?.lang || descriptor.script?.lang || 'js'
lang: descriptor.script?.lang || descriptor.scriptSetup?.lang || 'js'
}
}
}
Expand Down

0 comments on commit 2a0b948

Please sign in to comment.