If format is "esm" and "minify" is true, do not minify whitespaces by default to avoid breaking tree-shaking
Open
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 275
- PR merge metrics
- No merged PRs in 30d
Description
If you are building a library, minifying whitespaces removes pure annotations and breaks tree-shaking
For reference, see https://vitejs.dev/config/build-options.html#build-minify
By default `minify: true` should look something like this
```ts
//tsup.config.ts
esbuildOptions(options, { format }) {
// options.minify = true
options.minifyWhitespace = format === 'esm' ? false : true
options.minifyIdentifiers = true
options.minifySyntax = true
},
```
Contributor guide
Assessment
This issue has not been assessed yet.