rollup-plugin-web-worker-loader
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "rollup-plugin-web-worker-loader", | ||
"version": "0.1.0", | ||
"description": "Bundle", | ||
"version": "0.1.1", | ||
"description": "Rollup plugin to bundle web worker code to later be instantiated as a Worker", | ||
"main": "src/index.js", | ||
@@ -6,0 +6,0 @@ "repository": "https://github.com/darionco/rollup-plugin-web-worker-loader", |
@@ -13,2 +13,3 @@ const path = require('path'); | ||
const idMap = new Map(); | ||
const exclude = new Map(); | ||
let projectOptions = null; | ||
@@ -45,7 +46,7 @@ | ||
if (target && !idMap.has(importee)) { | ||
idMap.set(importee, Object.assign({}, projectOptions, { | ||
idMap.set(target, Object.assign({}, projectOptions, { | ||
input: target, | ||
})); | ||
return importee; | ||
return target; | ||
} | ||
@@ -57,4 +58,5 @@ } | ||
load: id => new Promise((resolve, reject) => { | ||
if (idMap.has(id)) { | ||
if (idMap.has(id) && !exclude.has(id)) { | ||
const inputOptions = idMap.get(id); | ||
exclude.set(id, true); | ||
rollup.rollup(inputOptions).then(bundle => { | ||
@@ -70,2 +72,3 @@ bundle.generate({ format: 'es', name: id, sourcemap: true }).then( result => { | ||
} | ||
exclude.delete(id); | ||
if (chunk !== null) { | ||
@@ -72,0 +75,0 @@ let source = utils.extractSource(chunk.code, chunk.exports); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27302
127