一覧へ戻る
wesmile2020/rollup-plugin-worker(新しいタブで開きます)
主要言語: TypeScript
a rollup plugin for worker
- star 数
- 6
- watcher 数
- 1
- fork 数
- 1
- issue 数
- 0
- 最終更新
- 2022/11/23
主要言語: TypeScript
a rollup plugin for worker
a rollup plugin for worker
Create a rollup.config.js and import the plugin:
const worker = require('rollup-plugin-worker'); module.exports = { plugins: [ worker({ prefix: 'worker!', plugins: [], uglify: false, }), ], };
import Worker from 'worker!./workers/worker.js'; const worker = new Worker();
Create a typing.d.ts in project and declare a module:
declare module 'worker!*' { class WebWorker extends Worker { constructor(); } export default WebWorker; }