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

It sucks to Ctrl-C 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 to install & save missing dependencies while you work!


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


In your webpack.config.js:

plugins: [
  new NpmInstallPlugin()

This is equivalent to:

plugins: [
  new NpmInstallPlugin({
    // Use --save or --save-dev
    dev: false,
    // Install missing peerDependencies
    peerDependencies: true,
    // Reduce amount of console logging
    quiet: false,
    // npm command used inside company, yarn is not supported yet
    npm: 'tnpm'

You can provide a Function to the dev to make it dynamic:

plugins: [
  new NpmInstallPlugin({
    dev: function(module, path) {
      return [
      ].indexOf(module) !== -1;


npm-install-webpack-plugin demo



Eric Clemmons

Jonny Buchanan