Files
meteor/tools/static-assets/server/runtime.js
Ben Newman c9ba0f3a22 Install latest Reify runtime in programs/server/main.js.
Also updated meteor-babel in the dev bundle to depend on reify@0.18.1, to
be consistent with the version used by server code.
2019-04-26 18:55:08 -04:00

21 lines
592 B
JavaScript

const Module = module.constructor;
const Mp = Module.prototype;
Mp.resolve = function (id) {
return Module._resolveFilename(id, this);
};
// Enable the module.{watch,export,...} runtime API needed by Reify.
require("reify/lib/runtime").enable(Mp);
const moduleLoad = Mp.load;
Mp.load = function (filename) {
const result = moduleLoad.apply(this, arguments);
if (typeof this.runSetters === "function") {
// Make sure we call module.runSetters (or module.runModuleSetters, a
// legacy synonym) whenever a module finishes loading.
this.runSetters();
}
return result;
};