Open ComLock opened 1 year ago
One of Esbuild's Design principles is to Maximize parallelism https://github.com/evanw/esbuild/blob/main/docs/architecture.md#design-principles
Which is great, and typically carries over into how people are writing esbuild plugins.
However when you use tsup and with build for multiple formats ['cjs', 'esm']: tsbuild runs the same esbuild-plugin, twice in parrallell.
I suspect esbuild-plugin developers don't image that happening, since they are developing for esbuild and not tsup.
I've run into a problem, because two copies of the same esbuild-plugin are writing to the same file, leading to a corrupt file: https://github.com/jfortunato/esbuild-plugin-manifest/pull/14
Perhaps there should be a generic solution in tsup to prevent this from happening?
esbuild has now documented how to build for multiple formats: https://github.com/jfortunato/esbuild-plugin-manifest#multiple-formats
Notice the awaits, aka no parallell...
One of Esbuild's Design principles is to Maximize parallelism https://github.com/evanw/esbuild/blob/main/docs/architecture.md#design-principles
Which is great, and typically carries over into how people are writing esbuild plugins.
However when you use tsup and with build for multiple formats ['cjs', 'esm']: tsbuild runs the same esbuild-plugin, twice in parrallell.
I suspect esbuild-plugin developers don't image that happening, since they are developing for esbuild and not tsup.
I've run into a problem, because two copies of the same esbuild-plugin are writing to the same file, leading to a corrupt file: https://github.com/jfortunato/esbuild-plugin-manifest/pull/14
Perhaps there should be a generic solution in tsup to prevent this from happening?
Upvote & Fund