Open itsyoboieltr opened 1 year ago
+1. Only with FS operations inside a build.mjs
script customizing the output of Bun.build to anything that isn't the same name as the entrypoint file is kind of a bummer, considering this shit can be done in ESBuild with almost no issues.
What is the problem this feature would solve?
It would be great if we could customize the output path for each entrypoint in Bun.build dynamically. I would suggest some kind of callback function for this, where we could do some pre-processing on the resolved path(s) before they are written on the disk. This would solve the problem, that currently the build either needs to have the same structure as the source code, or that it is needed to roll our own build script and manually loop over the files to customize the output path(s).
What is the feature you are proposing to solve the problem?
Callback function to modify the resolved path(s) before they are written on the disk. Maybe something like:
or
Or any other API that would be general enough to allow for more flexibility in terms of the saved paths of the files.
What alternatives have you considered?
The alternative is doing everything manually, but this should cause some performance and dev exp loss.