Skip to content

Commit 289c126

Browse files
committed
fix: add scan module type
1 parent e08ded5 commit 289c126

File tree

1 file changed

+3
-0
lines changed
  • packages/vite/src/node/optimizer

1 file changed

+3
-0
lines changed

packages/vite/src/node/optimizer/scan.ts

+3
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,7 @@ function rolldownScanPlugin(
577577
if (htmlTypesRE.test(id)) {
578578
return {
579579
code: await htmlTypeOnLoadCallback(id),
580+
moduleType: 'js'
580581
}
581582
}
582583

@@ -607,11 +608,13 @@ function rolldownScanPlugin(
607608

608609
if (contents.includes('import.meta.glob')) {
609610
return {
611+
moduleType: 'js', // since it is transpiled,
610612
code: await doTransformGlobImport(contents, id),
611613
}
612614
}
613615

614616
return {
617+
moduleType: loader,
615618
code: contents,
616619
}
617620
}

0 commit comments

Comments
 (0)