Skip to content

Commit

Permalink
fix: ensure canInlineMain logic is identical with before refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Apr 18, 2023
1 parent 6513ecf commit e6c5a90
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/plugin-vue/src/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ export function canInlineMain(
descriptor: SFCDescriptor,
options: ResolvedOptions,
): boolean {
if (!options.devServer) {
return false
}
if (descriptor.script?.src || descriptor.scriptSetup?.src) {
return false
}
const lang = descriptor.script?.lang || descriptor.scriptSetup?.lang
if (lang && lang !== 'ts') {
return false
if (!lang) {
return true
}
if ((lang === 'ts' || lang === 'tsx') && options.devServer) {
return true
}
return true
return false
}

0 comments on commit e6c5a90

Please sign in to comment.