huozhi / bunchee

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

Minification removes "use client" or "use server" directive after building. #462

Closed lovrozagar closed 9 months ago

lovrozagar commented 9 months ago

When using bunchee -m, minification removes the directive at the top of the file, components with "use client", after building, become server components even though they are separated into a x-client.js file. Works fine when using just bunchee without minification.

Originally posted by @lovrozagar in https://github.com/huozhi/bunchee/issues/305#issuecomment-1951378050