sourcemap is empty when using multiple entrypoint & esm
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 275
- PR merge metrics
- No merged PRs in 30d
Description
Hi. There is sourcemap issue in multiple entrypoint with esm
```
src/
- hello.ts
- index.ts
tsup.config.ts
```
``` ts
// src/index.ts
export * from './hello';
```
``` ts
// src/hello.ts
export function hello() {
console.log('hello');
}
```
``` ts
// tsup.config.ts
import { defineConfig } from 'tsup';
export default defineConfig({
entry: ['src/index.ts', 'src/hello.ts'],
format: ['esm'],
sourcemap: true,
});
```
when it build, both index.mjs.map, hello.mjs.map is empty
``` json
// dist/hello.mjs.map
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
// dist/index.mjs.map
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
```
only chunk file (`chunk-{hashed}`) has sourcemap. maybe chunking has sourcemap issue?
it works correctly with cjs format.
Thanks!
Contributor guide
Assessment
This issue has not been assessed yet.