Skip to content

Commit

Permalink
Add instructions to README
Browse files Browse the repository at this point in the history
  • Loading branch information
ericclemmons committed Dec 29, 2015
1 parent a3b82e1 commit 6326219
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,53 @@

> Webpack loader to automatically npm install & save dependencies.
### Why?

It sucks to <kbd>Ctrl-C</kbd> your
build script & server just to install
a dependency you didn't know you needed until now.

Instead, use `require` or `import` how
you normally would and `npm install` will happen automatically between reloads.

### Usage

In your `webpack.config.js`:

```js
module: {
postLoaders: [
{
exclude: /node_modules/,
loader: "npm-install-loader",
test: /\.js$/,
},
],
}
```

This will ensure that any other loaders
(e.g. `eslint-loader`, `babel-loader`,e tc.) have completed.

### Saving

This loader simply runs `npm install [modules]`.

I recommend creating an `.npmrc` file
in the root of your project with:

```ini
save=true
```

This will automatically save any dependencies anytime you run `npm install` (no need to pass `--save`).


### License

> MIT License 2015 © Eric Clemmons

[![travis build](https://img.shields.io/travis/ericclemmons/npm-install-loader.svg)](https://travis-ci.org/ericclemmons/npm-install-loader)
[![Coverage Status](https://coveralls.io/repos/ericclemmons/npm-install-loader/badge.svg?branch=master&service=github&style=flat-square)](https://coveralls.io/github/ericclemmons/npm-install-loader?branch=master)
[![version](https://img.shields.io/npm/v/npm-install-loader.svg)](http://npm.im/npm-install-loader)
Expand Down

0 comments on commit 6326219

Please sign in to comment.