Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

npm-install-webpack-plugin-cn

ericclemmons166MIT2.0.4

Webpack loader to automatically npm install & save dependencies.

webpack, webpack-plugin, npm, install

readme

npm-install-webpack-plugin

Speed up development by automatically installing & saving dependencies with Webpack.

npm-install-webpack-plugin mp4

Seamlessly works with:

  • <input checked="" disabled="" type="checkbox"> Javascript (e.g. require, import)
  • <input checked="" disabled="" type="checkbox"> CSS (e.g. @import "~bootstrap")
  • <input checked="" disabled="" type="checkbox"> Webpack loaders (e.g. babel-loader, file-loader, etc.)

travis build Coverage Status version downloads MIT License


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 install & save missing dependencies while you work!

Installation

$ npm install --save-dev npm-install-webpack-plugin

Usage

In your webpack.config.js:

plugins: [
  new NpmInstallPlugin(),
],

If you have an .npmrc file in your project, those arguments will be used:

save=true
save-exact=true

Alternatively, you can provide your own arguments to npm install:

plugins: [
  new NpmInstallPlugin({
    ...
    cacheMin: 999999  // --cache-min=999999 (prefer NPM cached version)
    registry: "..."   // --registry="..."
    save: true,       // --save
    saveDev: true,    // --save-dev
    saveExact: true,  // --save-exact
    ...
  }),
],

License

MIT License 2016 © Eric Clemmons

changelog

Change Log

2.0.2 (2016-01-31)

Full Changelog

Implemented enhancements:

  • Support loader shorthand (e.g. "babel" vs. "babel-loader") #16 (fritx)

v2.0.1 (2016-01-31)

Full Changelog

Fixed bugs:

  • Mismatch between code and documentation #18 (DLMR)

v2.0.0 (2016-01-24)

Full Changelog

Implemented enhancements:

Closed issues:

  • Transitive dependencies with npm3 #14
  • Strip webpack directives before running npm install #12
  • Missing require() pattern #11

v1.1.1 (2016-01-04)

Full Changelog

Fixed bugs:

  • Fix spawning npm on Windows #9 (insin)

v1.1.0 (2016-01-02)

Full Changelog

Implemented enhancements:

  • Use --save or --save-exact flags when installing based on loader query config #3 (insin)

v1.0.2 (2016-01-02)

Full Changelog

Implemented enhancements:

v1.0.1 (2015-12-30)

Full Changelog

Fixed bugs:

  • Support deep imports and multiple imports from the same module #4 (insin)

v1.0.0 (2015-12-29)

Implemented enhancements:

* This Change Log was automatically generated by github_changelog_generator