Skip to content

Commit

Permalink
fix: no need to use extensionAlias when using jsconfig.json (#4321)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored Jan 4, 2025
1 parent f6f718e commit d413f06
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core/src/plugins/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ export const pluginResolve = (): RsbuildPlugin => ({

chain.resolve.extensions.merge([...config.resolve.extensions]);

if (tsconfigPath) {
const isTsProject =
tsconfigPath && !tsconfigPath.endsWith('jsconfig.json');
if (isTsProject) {
// TypeScript allows importing TS files with `.js` extension
// See: https://github.com/microsoft/TypeScript/blob/c09e2ab4/src/compiler/moduleNameResolver.ts#L2151-L2168
chain.resolve.extensionAlias.merge({
Expand Down

1 comment on commit d413f06

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Ran ecosystem CI: Open

suite result
modernjs ❌ failure
plugins ✅ success
rspress ✅ success
rslib ✅ success
examples ✅ success

Please sign in to comment.