egoist / egoist/tsup

sourcemap is empty when using multiple entrypoint & esm

Open
#841 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.