browser-pack
Advanced tools
Comparing version 0.6.0 to 0.7.0
{ | ||
"name": "browser-pack", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"description": "pack node-style source files from a json stream into a browser bundle", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -11,9 +11,19 @@ | ||
(function(modules, cache, entry) { | ||
function innerReq(name, jumped){ | ||
// Save the require from previous bundle to this closure if any | ||
var previousRequire = typeof require == "function" && require; | ||
function newRequire(name, jumped){ | ||
if(!cache[name]) { | ||
if(!modules[name]) { | ||
// if we cannot find the item within our internal map jump to | ||
// current root require go all requires down from there | ||
var rootRequire = typeof require == "function" && require; | ||
if (!jumped && rootRequire) return rootRequire(name, true); | ||
// if we cannot find the the module within our internal map or | ||
// cache jump to the current global require ie. the last bundle | ||
// that was added to the page. | ||
var currentRequire = typeof require == "function" && require; | ||
if (!jumped && currentRequire) return currentRequire(name, true); | ||
// If there are other bundles on this page the require from the | ||
// previous one is saved to 'previousRequire'. Repeat this as | ||
// many times as there are bundles until the module is found or | ||
// we exhaust the require chain. | ||
if (previousRequire) return previousRequire(name, true); | ||
throw new Error('Cannot find module \'' + name + '\''); | ||
@@ -24,9 +34,11 @@ } | ||
var id = modules[name][1][x]; | ||
return innerReq(id ? id : x); | ||
return newRequire(id ? id : x); | ||
},m,m.exports); | ||
} | ||
return cache[name].exports | ||
return cache[name].exports; | ||
} | ||
for(var i=0;i<entry.length;i++) innerReq(entry[i]); | ||
return innerReq; | ||
for(var i=0;i<entry.length;i++) newRequire(entry[i]); | ||
// Override the current require with this new one | ||
return newRequire; | ||
}) |
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
19154
408
4