Skip to content

Commit

Permalink
Merge pull request #2143 from embroider-build/vite-hbs-cleanup
Browse files Browse the repository at this point in the history
Vite hbs plugin should return resolutions
  • Loading branch information
ef4 authored Oct 9, 2024
2 parents e757dc6 + d497306 commit 5b4f982
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/vite/src/hbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down Expand Up @@ -70,6 +73,8 @@ export function hbs(): Plugin {
},
};
}

return resolution;
},

load(id: string) {
Expand Down

0 comments on commit 5b4f982

Please sign in to comment.