Last active
August 29, 2015 14:06
-
-
Save es128/0075d01e8db68f8a745b to your computer and use it in GitHub Desktop.
Duo misses component.json deps on local install
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var example = require('./example-component'); | |
example(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function outer(modules, cache, entries){ | |
/** | |
* Global | |
*/ | |
var global = (function(){ return this; })(); | |
/** | |
* Require `name`. | |
* | |
* @param {String} name | |
* @param {Boolean} jumped | |
* @api public | |
*/ | |
function require(name, jumped){ | |
if (cache[name]) return cache[name].exports; | |
if (modules[name]) return call(name, require); | |
throw new Error('cannot find module "' + name + '"'); | |
} | |
/** | |
* Call module `id` and cache it. | |
* | |
* @param {Number} id | |
* @param {Function} require | |
* @return {Function} | |
* @api private | |
*/ | |
function call(id, require){ | |
var m = cache[id] = { exports: {} }; | |
var mod = modules[id]; | |
var name = mod[2]; | |
var fn = mod[0]; | |
fn.call(m.exports, function(req){ | |
var dep = modules[id][1][req]; | |
return require(dep ? dep : req); | |
}, m, m.exports, outer, modules, cache, entries); | |
// expose as `name`. | |
if (name) cache[name] = cache[id]; | |
return cache[id].exports; | |
} | |
/** | |
* Require all entries exposing them on global if needed. | |
*/ | |
for (var id in entries) { | |
if (entries[id]) { | |
global[entries[id]] = require(id); | |
} else { | |
require(id); | |
} | |
} | |
/** | |
* Duo flag. | |
*/ | |
require.duo = true; | |
/** | |
* Expose cache. | |
*/ | |
require.cache = cache; | |
/** | |
* Expose modules | |
*/ | |
require.modules = modules; | |
/** | |
* Return newest require. | |
*/ | |
return require; | |
})({ | |
1: [function(require, module, exports) { | |
var example = require('./example-component/'); | |
example(); | |
}, {"./example-component/":2}], | |
2: [function(require, module, exports) { | |
var fnArgs = require('fn-args'); | |
module.exports = function () { | |
console.log(fnArgs(function (a, b, c) {})) | |
}; | |
}, {}]}, {}, {"1":""}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "example-component", | |
"version": "0.0.0", | |
"main": "index.js", | |
"dependencies": { | |
"sindresorhus/fn-args": "^1.0.0" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fnArgs = require('fn-args'); | |
module.exports = function () { | |
console.log(fnArgs(function (a, b, c) {})) | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment