diff --git a/packages/vite/src/hbs.ts b/packages/vite/src/hbs.ts index 2b3acf784..793a09838 100644 --- a/packages/vite/src/hbs.ts +++ b/packages/vite/src/hbs.ts @@ -33,6 +33,9 @@ export function hbs(): Plugin { }); if (!resolution) { + // vite already has extension search fallback for extensionless imports. + // This is different, it covers an explicit .js import fallback to the + // corresponding hbs. let hbsSource = syntheticJStoHBS(source); if (hbsSource) { resolution = await this.resolve(hbsSource, importer, { @@ -70,6 +73,8 @@ export function hbs(): Plugin { }, }; } + + return resolution; }, load(id: string) {