-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Description
I happen to come across a better require statement for project specific imports.
This line goes into app.js:
global.rootRequire = function (name) {
return require(__dirname + '/' + name);
}This is helpful if you find yourself deep in a folder:
var auth = require('../../../auth/auth.service');
var auth = rootRequire('auth/auth.service');
Any thoughts?