Closed
Description
Details
input
// folder/index.ts
export const folder = 'folder';
// index.ts
import { folder } from './folder';
export const text = folder;
Output
import * as __WEBPACK_EXTERNAL_MODULE__folder_js__ from "./folder.js";
const src_text = __WEBPACK_EXTERNAL_MODULE__folder_js__.folder;
export { src_text as text };
rslib/packages/core/src/config.ts
Lines 693 to 721 in 600937c
In line 710, we directly add a jsExtension in bundless mode to make bundleless esm outputs work.
rslib/packages/core/src/config.ts
Line 710 in 600937c
- Modern.js Module forces user to add
/index
in bundleless mode. - Tsup do not add js extensions automatically, it forces user to write extensions in sourcecode
Index resolution is a standard behaviour which takes effects in both nodejs and ts, and Rslib now use default resolve.mainFiles: ['index']
of Rspack.
We should handle when ./folder/index.ts
and ./folder.ts
exists at the same time, there may also be .ts
, .tsx
, .jsx
existing.