Let's say i have following codes:
var mod1 = require('../../../../ok/mod1');
var mod2 = require('../../../info/mod2');
It's not pretty coding like above, i am wondering if there is a way to configure the root resolver just like webpack-resolve-root in nodejs?
So far as i know, the NODE_PATH
can be used to replace the root of node_modules
, but that's not what i want. I'd like to have the resolver to resolve multiple folders in order.
There is an npm package called module-alias that may do what you are looking for.