evanw / esbuild

An extremely fast bundler for the web
https://esbuild.github.io/
MIT License
38.01k stars 1.14k forks source link

WebWorker support? #312

Open ebrensi opened 4 years ago

ebrensi commented 4 years ago

Hi I just discovered esbuild, coming from Parcel. One thing I like about parcel is that if I instaniate a WebWorker with the string literal filename, like

const ww = new Worker ('./myWorker.js')
ww.postMessage('work!')

Parcel will recognize the Worker constructor and create another bundle starting at ./myWorker.js. It also handles cache busting for the filename. So the bundle would be called ./myWorker8a68r8912q.js or something and that string would be updated in the code above.

Does ESBuild do something like that? If not, where would I look to implement that?

fasiha commented 2 months ago

I saw this issue was still open and thought esbuild didn't support the new Worker approach with webworkers but https://github.com/evanw/esbuild/issues/2439 makes me think esbuild does support this?

firien commented 2 months ago

@fasiha, I believe #2439 is for allowing esbuild to preserve the comment, so it can make it to webpack. (https://github.com/privatenumber/esbuild-loader)

andrevenancio commented 1 month ago

Any updates?