web-infra-dev / web-infra-dev/rslib
[Bug]: Sourcemap is not generated for entry file which only do reexport in bundleless mode
Open
Nobody has claimed this yet.
Rspack
- Dominant language
- TypeScript
- Stars
- 1k
- Forks
- 67
- Avg merge
- 6h 9m
- Merged PRs (30d)
- 57
Description
Version
System:
OS: macOS 14.6.1
CPU: (10) arm64 Apple M1 Max
Memory: 371.86 MB / 64.00 GB
Shell: 5.9 - /bin/zsh
Browsers:
Chrome: 135.0.7049.96
Safari: 17.6
npmPackages:
@rslib/core: ^0.6.5 => 0.6.5
Details
In bundleless mode, if we enable sourcemap generation, the source file which contain only reexport statement do not generate source map file.
// foo.ts
export const foo = "foo";
// index.ts
export { foo } from "./foo";
Reproduce link
https://github.com/Timeless0911/rslib-reexport-sourcemap
Reproduce Steps
pnpm installpnpm build- check
dist/bundlelessfolder that theindex.js.mapis missing which exists indist/bundlefolder.
The output result is as below:
dist/
├── bundle
│ ├── index.js
│ └── index.js.map
└── bundleless
├── foo.js
├── foo.js.map
└── index.js
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked reproduction repository and run pnpm install followed by pnpm build. Compare the bundleless and bundle outputs in dist, focusing on why index.js lacks index.js.map when the entry file only reexports from foo.ts; done means the bundleless output includes the expected source map.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100