webworkify-webpack
Advanced tools
Comparing version 2.1.2 to 2.1.3
16
index.js
@@ -84,2 +84,6 @@ function webpackBootstrapFunc (modules) { | ||
function isNumeric(n) { | ||
return !isNaN(1 * n); // 1 * n converts integers, integers as string ("123"), 1e3 and "1e3" to integers and strings to NaN | ||
} | ||
function getModuleDependencies (sources, module, queueName) { | ||
@@ -113,2 +117,12 @@ var retval = {} | ||
// convert 1e3 back to 1000 - this can be important after uglify-js converted 1000 to 1e3 | ||
var keys = Object.keys(retval); | ||
for (var i = 0; i < keys.length; i++) { | ||
for (var j = 0; j < retval[keys[i]].length; j++) { | ||
if (isNumeric(retval[keys[i]][j])) { | ||
retval[keys[i]][j] = 1 * retval[keys[i]][j]; | ||
} | ||
} | ||
} | ||
return retval | ||
@@ -164,3 +178,3 @@ } | ||
var requiredModules = options.all ? { main: Object.keys(sources) } : getRequiredModules(sources, moduleId) | ||
var requiredModules = options.all ? { main: Object.keys(sources.main) } : getRequiredModules(sources, moduleId) | ||
@@ -167,0 +181,0 @@ var src = '' |
{ | ||
"name": "webworkify-webpack", | ||
"version": "2.1.2", | ||
"version": "2.1.3", | ||
"description": "launch a web worker at runtime that can require() in the browser with webpack", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
16321
223