Skip to content

Commit 03de8e5

Browse files
committed
fix(@angular/build): automatically resolve .mjs files when using Vite
Previously, ESM file resolution without extensions failed when using Vite, causing issues in module loading. This commit addresses the problem by automatically resolving `.mjs` files, aligning the behavior with the application builder and ensuring consistent module resolution across different build tools. Closes #27841
1 parent 9b702e1 commit 03de8e5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/angular/build/src/builders/dev-server/vite-server.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,7 @@ function getDepOptimizationConfig({
677677
supported: getFeatureSupport(target, zoneless),
678678
plugins,
679679
loader,
680+
resolveExtensions: ['.mjs', '.js'],
680681
},
681682
};
682683
}

0 commit comments

Comments
 (0)