Closed thecuvii closed 5 months ago
It sounds wrong to export ts file in exports
field, especially they're also the source file. If you're doing that and rely on the consumer side (which is the framework bundler or any app using a framework), you don't need bundling anymore since they're source files themselves. But in general it's a weird practice.
We could probably error with sth else but it's still going to be errored
I use this pattern in a monorepo, so I don't have to run a dev
command for each package.
The main issue here is that the "src" folder should not be deleted, as I may lose all my uncommitted source files.
Yea that's right, the src/
folder or source files shouldn't be auto deleted. I can fix that later.
But why it's using bunchee
if this package doesn't need to use bunchee? IMO it's weird to determine what to do if your input path is same as output or if your output is ts file
LOL, I use bunchee
, just trying to figure out if it's possible to export a TypeScript file for development only, and then encounter this problem.
yea should def keep the files there
When exporting a TypeScript file with the development field, such as
src/index.ts
, there will be anError [RollupError]: Could not resolve entry module "src/index.ts".
error, and thesrc
folder was deleted.https://github.com/huozhi/bunchee/assets/11806619/f1ad3eb9-d402-475d-95d2-289a9da8c910
repro: https://github.com/thecuvii/bunchee-development-repro