egoist / egoist/tsup

If format is "esm" and "minify" is true, do not minify whitespaces by default to avoid breaking tree-shaking

Open
#802 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

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

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.