A simple rollup plugin to create inline worker
Temporarily does not support packaging of importScripts
, import
and require
modules.
$ npm install rollup-plugin-worker-inline
In the rollup.config.js
, or you can test the sample file ./sample/rollup.config.js
import workerInline from 'rollup-plugin-worker-inline';
export default {
// ...
plugins: [
workerInline({
// The worker file passes `@babel/preset-env` and `babel-preset-minify` presets processing by default.
// Or you can customize the worker output yourself.
transform: code => code,
}),
],
// ...
};
MIT © Harvey Zack