In RequireJS, I can reassign the paths using the config file , for example:
require.config({
paths: {
foo: 'lib/foo/foo'
}
})
Then I can use foo like this:
require(['foo'], function(foo) {...})
In node.js, I may also need local files, for example:
var foo = require('../lib/foo/foo.js')
(In this example foo.js, this is a file that I wrote that is not accessible via npm.)
Is it possible to reassign 'foo'to '/lib/foo/foo.js'relatively some base directory in node.js, so I don't need to use relative paths?
source
share