web-infra-dev / web-infra-dev/rslib

[Bug]: Sourcemap is not generated for entry file which only do reexport in bundleless mode

Open
#942 0 comments 0 reactions 0 assignees View on GitHub

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
  1. pnpm install
  2. pnpm build
  3. check dist/bundleless folder that the index.js.map is missing which exists in dist/bundle folder.

The output result is as below:

dist/
├── bundle
│   ├── index.js
│   └── index.js.map
└── bundleless
    ├── foo.js
    ├── foo.js.map
    └── index.js

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.