huozhi / bunchee

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

`react-server` condition overwrites main dist files #541

Closed amannn closed 3 weeks ago

amannn commented 3 weeks ago

Hey, me again with a rather special bug report regarding export conditions! :)

I noticed that under a certain condition, the react-server export condition overwrites the the main dist files.

Here's a reproduction: https://github.com/amannn/bunchee-test/commit/81357ab21bfc210f4d69c93bd1725ceb0ef36cab

The key is the renaming src/rsc/test.tssrc/rsc/index.ts. The build output should stay the same in this example, but as you see in the commit, the main dist files are overwritten.

It seems like the usage of index.ts somehow breaks the output?

huozhi commented 3 weeks ago

Thanks for report! Fixed in 5.2.0

amannn commented 2 weeks ago

Seems to work, thanks a lot for the quick fix!