Skip to content

Commit

Permalink
refactor: use lang
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed May 3, 2022
1 parent e272667 commit 027fc71
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/plugin-vue/src/main.ts
Expand Up @@ -216,7 +216,9 @@ export async function transformMain(
},
meta: {
vite: {
isTs
lang: isTs
? 'ts'
: descriptor.scriptSetup?.lang || descriptor.script?.lang || 'js'
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/resolve.ts
Expand Up @@ -133,7 +133,7 @@ export function resolvePlugin(baseOptions: InternalResolveOptions): Plugin {
isFromTsImporter: !importer
? false
: isTsRequest(importer) ||
this.getModuleInfo(importer)?.meta?.vite?.isTs
this.getModuleInfo(importer)?.meta?.vite?.lang === 'ts'
}

let res: string | PartialResolvedId | undefined
Expand Down

0 comments on commit 027fc71

Please sign in to comment.