@sidvind/rollup-plugin-worker
v1.0.3
Published
Rollup plugin to import a worker and get the worker URL
Readme
@sidvind/rollup-plugin-worker
Rollup plugin to import a worker and get the worker URL.
- Import worker as URL
- Generates separate chunk for each worker.
- ESM only
- Typescript compatible
[!IMPORTANT] This plugin is intended for my own use-cases and I'll maintain it as such. Feel free to use it as you feel fit but I will not accept feature requests without pull requests, i.e. if you don't intend to put in the work yourself it is unlikely to be implemented. Issues and bugs are accepted.
Usage
import { Worker } from "node:worker_threads";
import workerUrl from "./awesome-worker?worker&url";
const worker = new Worker(workerUrl);This generates a separate chunk awesome-worker-[chunk].js and is exported as a URL to the chunk.
