/rollup-plugin-worker-inline

A simple rollup plugin to create inline worker

Primary LanguageJavaScriptMIT LicenseMIT

rollup-plugin-worker-inline

version license npm Downloads

A simple rollup plugin to create inline worker

Temporarily does not support packaging of importScripts, import and require modules.

Install

$ npm install rollup-plugin-worker-inline

Usage

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,
        }),
    ],
    // ...
};

License

MIT © Harvey Zack