{"_id":"rollup-plugin-off-main-thread","_rev":"345961","name":"rollup-plugin-off-main-thread","description":"Use Rollup with workers and ES6 modules today.","dist-tags":{"latest":"1.1.0","next":"1.1.1-0"},"maintainers":[{"name":"surma","email":"surma@surmair.de"}],"time":{"modified":"2021-06-20T02:39:43.000Z","created":"2019-07-18T16:02:13.875Z","1.1.1-0":"2019-07-21T15:45:15.775Z","1.1.0":"2019-07-18T22:22:50.333Z","1.0.1":"2019-07-18T16:18:43.284Z","1.0.0":"2019-07-18T16:02:13.875Z"},"users":{},"author":{"name":"Surma","email":"surma@google.com"},"repository":{"type":"git","url":"git+https://github.com/surma/rollup-plugin-off-main-thread.git"},"versions":{"1.1.1-0":{"name":"rollup-plugin-off-main-thread","version":"1.1.1-0","description":"Use Rollup with workers and ES6 modules today.","main":"index.js","scripts":{"fmt":"prettier --write 'tests/**/*.js' *.js *.md *.json","test":"node ./run_tests.js"},"author":{"name":"Surma","email":"surma@google.com"},"license":"Apache-2.0","devDependencies":{"chai":"4.2.0","karma":"4.2.0","karma-chai":"0.1.0","karma-chrome-launcher":"3.0.0","karma-firefox-launcher":"1.1.0","karma-mocha":"1.3.0","karma-safari-launcher":"1.0.0","karma-safaritechpreview-launcher":"2.0.2","mocha":"6.1.4","prettier":"1.18.2","rollup":"1.16.2"},"repository":{"type":"git","url":"git+https://github.com/surma/rollup-plugin-off-main-thread.git"},"dependencies":{"ejs":"^2.6.1","magic-string":"^0.25.0"},"readmeFilename":"README.md","gitHead":"7be5a461dd0b91bb90ad7722eb7225cde7f5666d","bugs":{"url":"https://github.com/surma/rollup-plugin-off-main-thread/issues"},"homepage":"https://github.com/surma/rollup-plugin-off-main-thread#readme","_id":"rollup-plugin-off-main-thread@1.1.1-0","_nodeVersion":"12.2.0","_npmVersion":"6.10.1","dist":{"shasum":"7fec475591b72e3351f15a7cc37adef43e570a80","size":11778,"noattachment":false,"key":"/rollup-plugin-off-main-thread/-/rollup-plugin-off-main-thread-1.1.1-0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rollup-plugin-off-main-thread/download/rollup-plugin-off-main-thread-1.1.1-0.tgz"},"maintainers":[{"name":"surma","email":"surma@surmair.de"}],"_npmUser":{"name":"surma","email":"surma@surma.link"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rollup-plugin-off-main-thread_1.1.1-0_1563723915638_0.7726411300135474"},"_hasShrinkwrap":false,"publish_time":1563723915775,"_cnpm_publish_time":1563723915775},"1.1.0":{"name":"rollup-plugin-off-main-thread","version":"1.1.0","description":"Use Rollup with workers and ES6 modules today.","main":"index.js","scripts":{"fmt":"prettier --write 'tests/**/*.js' *.js *.md *.json","test":"node ./run_tests.js"},"author":{"name":"Surma","email":"surma@google.com"},"license":"Apache-2.0","devDependencies":{"chai":"4.2.0","karma":"4.2.0","karma-chai":"0.1.0","karma-chrome-launcher":"3.0.0","karma-firefox-launcher":"1.1.0","karma-mocha":"1.3.0","karma-safari-launcher":"1.0.0","karma-safaritechpreview-launcher":"2.0.2","mocha":"6.1.4","prettier":"1.18.2","rollup":"1.16.2"},"repository":{"type":"git","url":"git+https://github.com/surma/rollup-plugin-off-main-thread.git"},"dependencies":{"ejs":"^2.6.1","magic-string":"^0.25.0"},"gitHead":"0f55c8422fd9c5ee28a152fc23be6e7f7767d448","bugs":{"url":"https://github.com/surma/rollup-plugin-off-main-thread/issues"},"homepage":"https://github.com/surma/rollup-plugin-off-main-thread#readme","_id":"rollup-plugin-off-main-thread@1.1.0","_nodeVersion":"12.2.0","_npmVersion":"6.10.1","dist":{"shasum":"ddddaff452a0b4d7eaf2bf6bfd7685051452dab6","size":11930,"noattachment":false,"key":"/rollup-plugin-off-main-thread/-/rollup-plugin-off-main-thread-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rollup-plugin-off-main-thread/download/rollup-plugin-off-main-thread-1.1.0.tgz"},"maintainers":[{"name":"surma","email":"surma@surmair.de"}],"_npmUser":{"name":"surma","email":"surma@surma.link"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rollup-plugin-off-main-thread_1.1.0_1563488570205_0.011199706017507527"},"_hasShrinkwrap":false,"publish_time":1563488570333,"_cnpm_publish_time":1563488570333,"deprecated":"For compatibility with GitHub’s npm registry, this package has moved to @surma/rollup-plugin-off-main-thread"},"1.0.1":{"name":"rollup-plugin-off-main-thread","version":"1.0.1","description":"Use Rollup with workers and ES6 modules today.","main":"index.js","scripts":{"fmt":"prettier --write 'tests/**/*.js' *.js *.md *.json","test":"node ./run_tests.js"},"author":{"name":"Surma","email":"surma@google.com"},"license":"Apache-2.0","devDependencies":{"chai":"4.2.0","karma":"4.2.0","karma-chai":"0.1.0","karma-chrome-launcher":"3.0.0","karma-firefox-launcher":"1.1.0","karma-mocha":"1.3.0","karma-safari-launcher":"1.0.0","karma-safaritechpreview-launcher":"2.0.2","mocha":"6.1.4","prettier":"1.18.2","rollup":"1.16.2"},"repository":{"type":"git","url":"git+https://github.com/surma/rollup-plugin-off-main-thread.git"},"dependencies":{"ejs":"^2.6.1","magic-string":"^0.25.0"},"gitHead":"05d702881b7eb444a7c1c0186e3e5d56a10061e1","bugs":{"url":"https://github.com/surma/rollup-plugin-off-main-thread/issues"},"homepage":"https://github.com/surma/rollup-plugin-off-main-thread#readme","_id":"rollup-plugin-off-main-thread@1.0.1","_nodeVersion":"12.4.0","_npmVersion":"6.9.0","dist":{"shasum":"5768ec7983b082b5e8e8dfe0ccc3473b8d031869","size":12085,"noattachment":false,"key":"/rollup-plugin-off-main-thread/-/rollup-plugin-off-main-thread-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/rollup-plugin-off-main-thread/download/rollup-plugin-off-main-thread-1.0.1.tgz"},"maintainers":[{"name":"surma","email":"surma@surmair.de"}],"_npmUser":{"name":"surma","email":"surma@surma.link"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rollup-plugin-off-main-thread_1.0.1_1563466723176_0.243011204624763"},"_hasShrinkwrap":false,"publish_time":1563466723284,"_cnpm_publish_time":1563466723284,"deprecated":"For compatibility with GitHub’s npm registry, this package has moved to @surma/rollup-plugin-off-main-thread"},"1.0.0":{"name":"rollup-plugin-off-main-thread","version":"1.0.0","description":"Use Rollup with workers and ES6 modules today.","main":"index.js","scripts":{"fmt":"prettier --write 'tests/**/*.js' *.js *.md *.json","test":"node ./run_tests.js"},"author":{"name":"Surma","email":"surma@google.com"},"license":"Apache-2.0","devDependencies":{"chai":"4.2.0","karma":"4.2.0","karma-chai":"0.1.0","karma-chrome-launcher":"3.0.0","karma-firefox-launcher":"1.1.0","karma-mocha":"1.3.0","karma-safari-launcher":"1.0.0","karma-safaritechpreview-launcher":"2.0.2","mocha":"6.1.4","prettier":"1.18.2","rollup":"1.16.2"},"repository":{"type":"git","url":"git+https://github.com/surma/rollup-plugin-off-main-thread.git"},"dependencies":{"ejs":"^2.6.1","magic-string":"^0.25.0"},"gitHead":"49a5896963d25e103048411961586dd4dae10e6d","bugs":{"url":"https://github.com/surma/rollup-plugin-off-main-thread/issues"},"homepage":"https://github.com/surma/rollup-plugin-off-main-thread#readme","_id":"rollup-plugin-off-main-thread@1.0.0","_nodeVersion":"12.4.0","_npmVersion":"6.9.0","dist":{"shasum":"fcba42836a6f5baa774c0dc62deb0dd8baaf9872","size":12011,"noattachment":false,"key":"/rollup-plugin-off-main-thread/-/rollup-plugin-off-main-thread-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rollup-plugin-off-main-thread/download/rollup-plugin-off-main-thread-1.0.0.tgz"},"maintainers":[{"name":"surma","email":"surma@surmair.de"}],"_npmUser":{"name":"surma","email":"surma@surma.link"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rollup-plugin-off-main-thread_1.0.0_1563465733746_0.3547342913842886"},"_hasShrinkwrap":false,"publish_time":1563465733875,"_cnpm_publish_time":1563465733875,"deprecated":"For compatibility with GitHub’s npm registry, this package has moved to @surma/rollup-plugin-off-main-thread"}},"readme":"# rollup-plugin-off-main-thread\n\nUse Rollup with workers and ES6 modules _today_.\n\n```\n$ npm install --save rollup-plugin-off-main-thread\n```\n\nWorkers are JavaScript’s version of threads. [Workers are important to use][when workers] as the main thread is already overloaded, especially on slower or older devices.\n\nThis plugin takes care of shimming module support in workers and allows you to use `new Worker()`.\n\nOMT is the result of merging loadz0r and workz0r.\n\n## Usage\n\n```js\n// rollup.config.js\nimport OMT from \"rollup-plugin-off-main-thread\";\n\nexport default {\n  input: [\"src/main.js\"],\n  output: {\n    dir: \"dist\",\n    // You _must_ use “amd” as your format\n    format: \"amd\"\n  },\n  plugins: [OMT()]\n};\n```\n\nI set up [a gist] to show a full setup with OMT.\n\n## Options\n\n```js\n{\n  // ...\n  plugins: [OMT(options)];\n}\n```\n\n- `loader`: A string containing the EJS template for the amd loader. If `undefined`, OMT will use `loader.ejs`.\n- `useEval`: Use `fetch()` + `eval()` to load dependencies instead of `<script>` tags and `importScripts()`. _This is not CSP compliant, but is required if you want to use dynamic imports in ServiceWorker_.\n- `marker`: A string that is temporarily injected to mark `new Worker()` calls. It’s only purpose is to be unique enough that the string sequence can’t appear by coincidence in ohter places. The default should be fine 99% of the time.\n- `workerRegexp`: A RegExp to find `new Workers()` calls. The second capture group _must_ capture the provided file name without the quotes.\n- `filenameRegexp`: A RegExp that finds the file name after Rollup has transformed dynamic imports.\n- `amdFunctionName`: Function name to use instead of AMD’s `define`\n\n[when workers]: https://dassur.ma/things/when-workers\n[a gist]: https://gist.github.com/surma/a02db7b53eb3e7870bf539b906ff6ff6\n\n---\n\nLicense Apache-2.0\n","_attachments":{},"homepage":"https://github.com/surma/rollup-plugin-off-main-thread#readme","bugs":{"url":"https://github.com/surma/rollup-plugin-off-main-thread/issues"},"license":"Apache-2.0"}