Skip to content

Commit ed7bdc5

Browse files
authored
feat: scan .marko files (#14669)
1 parent 45595ef commit ed7bdc5

File tree

1 file changed

+7
-1
lines changed
  • packages/vite/src/node/optimizer

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,13 @@ function shouldExternalizeDep(resolvedId: string, rawId: string): boolean {
661661
}
662662

663663
function isScannable(id: string): boolean {
664-
return JS_TYPES_RE.test(id) || htmlTypesRE.test(id)
664+
// From Vite 5, all optimizeDeps.extensions are scannable. We hardcode .marko for 4.5.0 to avoid
665+
// potential regressions. See https://github.com/vitejs/vite/pull/14543
666+
return (
667+
JS_TYPES_RE.test(id) ||
668+
htmlTypesRE.test(id) ||
669+
path.extname(id) === '.marko'
670+
)
665671
}
666672

667673
// esbuild v0.18 only transforms decorators when `experimentalDecorators` is set to `true`.

0 commit comments

Comments
 (0)