https://github.com/ext/rollup-plugin-worker
Rollup plugin to import a worker and get the worker URL
https://github.com/ext/rollup-plugin-worker
Last synced: about 1 year ago
JSON representation
Rollup plugin to import a worker and get the worker URL
- Host: GitHub
- URL: https://github.com/ext/rollup-plugin-worker
- Owner: ext
- Created: 2025-04-30T19:12:20.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-10T08:09:08.000Z (about 1 year ago)
- Last Synced: 2025-05-10T09:20:45.864Z (about 1 year ago)
- Language: JavaScript
- Size: 86.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @sidvind/rollup-plugin-worker
[](https://www.npmjs.com/package/@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
```ts
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.