This commit is contained in:
Philipp Kunz 2017-03-04 18:13:51 +01:00
parent 20a038892b
commit d482e233a6
2 changed files with 11 additions and 11 deletions

2
dist/index.js vendored
View File

@ -52,4 +52,4 @@ exports.injectFileArray = (fileArray) => __awaiter(this, void 0, void 0, functio
}
return fileArray;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEsMEJBQXVCO0FBRXZCLElBQUksTUFBTSxHQUFHLE9BQU8sQ0FBQyxRQUFRLENBQUMsQ0FBQztBQUUvQixnREFBaUQ7QUFDakQscUNBQXNDO0FBS3RDLFNBQVMsQ0FBQyxPQUFPLENBQUM7SUFDaEIsWUFBWSxFQUFFLFVBQVUsSUFBSTtRQUMxQixFQUFFLENBQUMsQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDO1lBQ2hCLE1BQU0sQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLENBQUMsUUFBUSxDQUFDLFFBQVEsRUFBRSxDQUFDO1FBQ3pDLENBQUM7SUFDSCxDQUFDO0NBQ0YsQ0FBQyxDQUFDO0FBR0gsSUFBSSxLQUFLLEdBQUcsRUFBRSxDQUFDO0FBQ2YsSUFBSSxjQUFjLEdBQUcsTUFBTSxDQUFDLFdBQVcsQ0FBQyxLQUFLLENBQUMsQ0FBQztBQUUvQyxNQUFNLENBQUMsV0FBVyxDQUFDLEtBQUssQ0FBQyxHQUFHLFVBQVUsTUFBTSxFQUFFLFFBQVE7SUFDcEQsSUFBSSxJQUFJLEdBQUcsS0FBSyxDQUFDLFFBQVEsQ0FBQyxDQUFDO0lBQzNCLEVBQUUsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUM7UUFDVCxNQUFNLENBQUMs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1QjtJQUN6RCxHQUFHLENBQUMsQ0FBQyxJQUFJLFVBQVUsSUFBSSxTQUFTLENBQUMsQ0FBQyxDQUFDO1FBQ2pDLEtBQUssQ0FBQyxVQUFVLENBQUMsSUFBSSxDQUFDLEdBQUcsVUFBVSxDQUFBO0lBQ3JDLENBQUM7SUFDRCxNQUFNLENBQUMsU0FBUyxDQUFBO0FBQ2xCLENBQUMsQ0FBQSxDQUFBIn0=

View File

@ -11,23 +11,23 @@ import { Transform } from 'stream'
sourceMap.install({
retrieveFile: function (path) {
if (cache[path]) {
return cache[path].contents.toString();
return cache[path].contents.toString()
}
}
});
})
let cache = {};
let originalLoader = Module._extensions['.js'];
let originalLoader = Module._extensions['.js']
Module._extensions['.js'] = function (module, filename) {
let file = cache[filename];
let file = cache[filename]
if (file) {
module._compile(file.contents.toString(), filename);
module._compile(file.contents.toString(), filename)
} else {
originalLoader.apply(this, arguments);
originalLoader.apply(this, arguments)
}
}
};
let originalModuleResolve = Module._resolveFilename
@ -38,15 +38,15 @@ Module._resolveFilename = function (request, parent, isMain) {
} else {
return originalModuleResolve.apply(this, arguments)
}
};
}
export let gulpPipe = function () {
return through2.obj(function (file, enc, cb) {
cache[file.path] = file;
return cb(null, file);
});
};
})
}
export interface fileObject {
path: string