{"library":"rollup-plugin-worker","title":"rollup-plugin-worker","description":"Rollup plugin to bundle Web Workers using a custom prefix import syntax (e.g., `worker!./worker.js`). v3.0.4 supports Rollup 3.x. It allows specifying worker-specific plugins and enables uglification. Provides TypeScript types. Differentiator: uses a prefix syntax rather than URL or inline blob, enabling easy bundling.","language":"javascript","status":"active","last_verified":"Mon Apr 27","install":{"commands":["npm install rollup-plugin-worker"],"cli":null},"imports":["import worker from 'rollup-plugin-worker'","import Worker from 'worker!./workers/worker.js'","declare module 'worker!*' { class WebWorker extends Worker { constructor(); } export default WebWorker; }"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// rollup.config.js\nimport worker from 'rollup-plugin-worker';\n\nexport default {\n  input: 'src/main.js',\n  plugins: [\n    worker({\n      prefix: 'worker!',\n      plugins: [],\n      uglify: false,\n    }),\n  ],\n  output: {\n    file: 'dist/bundle.js',\n    format: 'iife',\n  },\n};\n\n// src/main.js\nimport MyWorker from 'worker!./worker.js';\nconst w = new MyWorker();\nw.postMessage('hello');","lang":"javascript","description":"Configures rollup-plugin-worker in rollup.config.js and shows usage in main.js with a custom worker import prefix.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}