work.suroh.tk/node_modules/app-module-path/register.js

8 lines
305 B
JavaScript
Raw Normal View History

2019-12-02 12:22:45 +00:00
var dirname = require('path').dirname;
var addPath = require('.').addPath;
addPath(dirname(module.parent.filename), module.parent);
// https://github.com/jhnns/rewire/blob/master/lib/index.js
delete require.cache[__filename]; // deleting self from module cache so the parent module is always up to date