-
I've been at this for a little while now, and I can't seem to figure out how to get Bun to handle web worker files when creating a javascript bundle. So far, the only thing I've gotten to work, is to manually build workers as entries, and use the final built path of the worker file in my source code so once it's transpiled, it references the file correctly. This is far from ideal, obviously. I should be able to reference a relative-path typescript file in my source code, and have it replaced with the relative path to the transpiled asset at build time. For compiling single executables, this appears to already be handled (https://github.com/oven-sh/bun/blob/main/docs/bundler/executables.md#worker) but as far as I can tell, no such feature exists when bundling? Is there something simple I'm missing, or does this functionality not yet exist? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I ended up hacking together build plugins to handle implicit building of workers and rebundling asset files, which works surprisingly well. Would still be great if Bun handled this automatically, but it's definitely not a trivial operation. |
Beta Was this translation helpful? Give feedback.
I ended up hacking together build plugins to handle implicit building of workers and rebundling asset files, which works surprisingly well.
Would still be great if Bun handled this automatically, but it's definitely not a trivial operation.