egoist / tsup

The simplest and fastest way to bundle your TypeScript libraries.
https://tsup.egoist.dev
MIT License
9.01k stars 217 forks source link

Support or override rollup ouput config `sanitizeFileName` #990

Open magne4000 opened 1 year ago

magne4000 commented 1 year ago

Add the ability to override sanitizeFileName in rollup outputConfig. By default, characters like + are replaced with _, thus generating differences between artifacts names in the following case:

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 <--

Upvote & Fund

Fund with Polar