huozhi / bunchee

Zero config bundler for ECMAScript and TypeScript packages
https://npmjs.com/bunchee
926 stars 29 forks source link

[Feature Request] `.min.js` entry to be minified by default #464

Open devjiwonchoi opened 7 months ago

devjiwonchoi commented 7 months ago

Example

package.json

{
  "main": "./dist/index.min.js"
}

CLI

bunchee ./src/index.ts -o ./dist/index.min.js

I'd love to contribute.

huozhi commented 7 months ago

Was thinking of the same thing few days ago, but found that I need to rewrite the exports parser to make it work. Current composition of different conditions are not very ideal.

Also need to avoid minification being applied to some optimize condition like “development”

devjiwonchoi commented 7 months ago

I see. Maybe later when handling the exports are rewritten?

huozhi commented 5 months ago

This should be available to do now, we can only apply this for bundle files configured in exports field. But we don't apply it to CLI

devjiwonchoi commented 5 months ago

Got it, will take a look shortly!