Open nestarz opened 2 years ago
It would be really cool if there were a way to hook into the build. I want to use vanilla-extract which has an esbuild plugin.
@nestarz, where in fresh do you put your current hack
?
@nestarz Feel free to open a PR that prevents init if init has already happened.
It would be really cool if there were a way to hook into the build. I want to use vanilla-extract which has an esbuild plugin.
@nestarz, where in fresh do you put your
current hack
?
@dagda1 I use this hack just before any use of esbuild in my scripts (so it is not in fresh codebase).
@lucacasonato I opened a PR that prevents error if init has already happened.
Am I right in understanding that esbuild.initialize()
already only triggers once? If so, I'll close this issue and #980.
Am I right in understanding that
esbuild.initialize()
already only triggers once? If so, I'll close this issue and #980.
It does, but if any other library or the user use esbuild and initialize it before, it will throw an unhandled exception caused by the code in fresh. Hence #980
I would like to reuse the esbuild runtime because I can't init it twice or an error occurs. Can we expose the function, or check if esbuild has already been initialized ? If so, I can make a PR.
This fails because fresh may have already initialized the runtime, and if not, fresh will crash because it doesn't know I did it:
Current hack: