Open austincummings opened 2 years ago
parcel seems supporting service worker https://github.com/parcel-bundler/parcel/pull/398
This looks something we should support in the future. Thank you for raising the issue
You can setup a temporary solutions using a plugin https://github.com/okikio/bundle/blob/main/plugins/worker.js
To use workers you would then,
import FILE_WORKER_URL from "worker:./workers/file.ts";
// ...
new Worker(FILE_WORKER_URL, { /* Any other options you need... */ })
@Blue-Skyer I would assume that by looking at the URL it would be rather clear where the solution came from.
These types of dependencies may end up being something that comes for free if esbuild adds support for these syntaxes, but I figured I would create an issue to propose this here too for consideration.
evanw/esbuild#312 evanw/esbuild#1602
Edit: Could maybe even pull in this plugin that looks to add support for
new Worker
, and then add a similar plugin for service workers