wallet-core/node_modules/enhanced-resolve/lib/ModulesInRootPlugin.js

23 lines
640 B
JavaScript
Raw Normal View History

2017-05-03 15:35:00 +02:00
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
function ModulesInRootPlugin(source, path, target) {
this.source = source;
this.path = path;
this.target = target;
}
module.exports = ModulesInRootPlugin;
ModulesInRootPlugin.prototype.apply = function(resolver) {
var target = this.target;
var path = this.path;
resolver.plugin(this.source, function(request, callback) {
var obj = Object.assign({}, request, {
path: path,
request: "./" + request.request
});
resolver.doResolve(target, obj, "looking for modules in " + path, callback, true);
});
};