fix scope of parent

This commit is contained in:
Philipp Kunz 2017-07-30 16:45:12 +02:00
parent ffbee08514
commit 26716cd49a
2 changed files with 3 additions and 3 deletions

4
dist/index.js vendored
View File

@ -40,9 +40,9 @@ Module._extensions['.js'] = function (module, filename) {
}; };
let originalModuleResolve = Module._resolveFilename; let originalModuleResolve = Module._resolveFilename;
Module._resolveFilename = function (request, parent, isMain) { Module._resolveFilename = function (request, parent, isMain) {
let parsedIdDir = path.parse(parent.id).dir;
let resolvedRequest; let resolvedRequest;
if (parent) { if (parent) {
let parsedIdDir = path.parse(parent.id).dir;
resolvedRequest = path.join('/', parent.id, request); resolvedRequest = path.join('/', parent.id, request);
} }
else { else {
@ -71,4 +71,4 @@ exports.injectFileArray = (fileArray) => __awaiter(this, void 0, void 0, functio
} }
return fileArray; return fileArray;
}); });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEsMEJBQXVCO0FBRXZCLElBQUksTUFBTSxHQUFHLE9BQU8sQ0FBQyxRQUFRLENBQUMsQ0FBQTtBQUM5Qiw2QkFBNkI7QUFDN0IsZ0RBQWdEO0FBQ2hELHFDQUFxQztBQUtyQyxTQUFTLENBQUMsT0FBTyxDQUFDO0lBQ2hCLFlBQVksRUFBRSxVQUFVLElBQUk7UUFDMUIsRUFBRSxDQUFDLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQztZQUNoQixNQUFNLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxDQUFDLFFBQVEsQ0FBQyxRQUFRLEVBQUUsQ0FBQTtRQUN4QyxDQUFDO1FBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQyxDQUFDLEtBQUssQ0FBQyxJQUFJLEdBQUcsS0FBSy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UFBRSxDQUFDLElBQUksRUFBRSxJQUFJLENBQUMsQ0FBQTtJQUN2QixDQUFDLENBQUMsQ0FBQTtBQUNKLENBQUMsQ0FBQTtBQU9VLFFBQUEsZUFBZSxHQUFHLENBQU8sU0FBdUI7SUFDekQsR0FBRyxDQUFDLENBQUMsSUFBSSxVQUFVLElBQUksU0FBUyxDQUFDLENBQUMsQ0FBQztRQUNqQyw2Q0FBNkM7UUFDN0MsS0FBSyxDQUFDLFVBQVUsQ0FBQyxJQUFJLENBQUMsR0FBRyxVQUFVLENBQUE7SUFDckMsQ0FBQztJQUNELE1BQU0sQ0FBQyxTQUFTLENBQUE7QUFDbEIsQ0FBQyxDQUFBLENBQUEifQ==

View File

@ -36,9 +36,9 @@ Module._extensions['.js'] = function (module, filename) {
let originalModuleResolve = Module._resolveFilename let originalModuleResolve = Module._resolveFilename
Module._resolveFilename = function (request, parent, isMain) { Module._resolveFilename = function (request, parent, isMain) {
let parsedIdDir = path.parse(parent.id).dir
let resolvedRequest: string let resolvedRequest: string
if (parent) { if (parent) {
let parsedIdDir = path.parse(parent.id).dir
resolvedRequest = path.join('/', parent.id, request) resolvedRequest = path.join('/', parent.id, request)
} else { } else {
resolvedRequest = request resolvedRequest = request