live-resolve
Avoid annoying relative paths in your require calls, and synchronize the search paths between Node.js and the Browser (Webpack).
Wrapper around add-module-paths
for Node.js.
Modifies Webpack's resolve settings config for the Browser.
Install
npm i -S live-resolve
Usage
Make sure your project is using the config
module.
Add your paths to live.resolve
in config/default.js
, for example:
moduleexports = live: resolve: moduleDirectories: 'node_modules' 'modules' alias: // Avoid conflicts with between npm and bower. bower: 'bower_components'
Why?
When using webpack and building an isomorphic web app we use require
in the Browser as well as Node.js, and we need the require path resolution to work the same in both environments.
Also, we want to configure this in a central config
file.
Discussions
A good summary of all the choices for Node.js