0.0.1 • Published 9 years ago

live-resolve v0.0.1

Weekly downloads
4
License
-
Repository
-
Last release
9 years ago

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:

module.exports = {
  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

0.0.1

9 years ago