wallet-core/node_modules/require-precompiled/index.js
2017-05-28 00:40:43 +02:00

19 lines
392 B
JavaScript

'use strict';
module.exports = install;
function install(precompile, ext, extensions) {
ext = ext || '.js';
extensions = extensions || require.extensions;
var oldExtension = extensions[ext];
extensions[ext] = function (module, filename) {
var source = precompile(filename);
if (source) {
module._compile(source, filename);
return;
}
oldExtension(module, filename);
};
}