Created
April 6, 2016 08:43
-
-
Save simonmcmanus/6a77a95e3d2f23fc4590da46484d80ca to your computer and use it in GitHub Desktop.
avoid using projRequire in NodeBB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require('path'); | |
require.main._req = require.main.require; | |
require.main.require = function(mod) { | |
if ((mod.startsWith('./') || mod.startsWith('/'))) { | |
var fullPath = path.join(__dirname,'\\',mod); | |
return require.main._req(fullPath); | |
} | |
return require.main._req(mod); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment