Support or override rollup ouput config `sanitizeFileName`
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 275
- PR merge metrics
- No merged PRs in 30d
Description
Add the ability to override `sanitizeFileName` in [rollup outputConfig](https://github.com/egoist/tsup/blob/9b813620a884f5b780346a240c51ead321227bce/src/rollup.ts#L201).
By default, characters like `+` are replaced with `_`, thus generating differences between artifacts names in the following case:
```ts
import { defineConfig } from 'tsup';
export default defineConfig([
{
entry: ['./+config.h.ts'],
format: ['esm'],
dts: {
entry: ['./+config.h.ts'],
},
},
]);
```
It currently generates the following files:
```
- /dist/+config.h.js
- /dist/_config.h.d.ts <--
```
With `sanitizeFileName: false`, the file names would be more correct and predictable:
```
- /dist/+config.h.js
- /dist/+config.h.d.ts <--
```
Contributor guide
Assessment
This issue has not been assessed yet.