It is inefficient 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 installation
will happen automatically to install & save missing dependencies while you work!
$ npm install --save-dev install-webpack-pluginIn your webpack.config.js:
plugins: [
  new InstallPlugin()
],This is equivalent to:
plugins: [
  new InstallPlugin({
    dependencies: {
      peer: true,
    },
    packageManager: {
      type: this.getDefaultPackageManager(),
      options: {
        dev: false,
        quiet: false,
      },
    },
    prompt: true,
  });
],Type: Object
Dependencies related options.
Type: Boolean
Default: true
Install missing peer dependencies.
plugins: [
  new InstallPlugin({
    dependencies: {
      peer: true,
    }
  }),
],Type: 'npm' | 'yarn' | 'pnpm' | Object | Function
Package manager to use for installing dependencies.
plugins: [
  new InstallPlugin({
      packageManager: 'yarn'
    },
  }),
],You can provide a Function to the packageManager to make it dynamic:
plugins: [
  new InstallPlugin({
    packageManager: function(module, path) {
      return [
        "babel-preset-react-hmre",
        "webpack-dev-middleware",
        "webpack-hot-middleware",
      ].indexOf(module) !== -1;
    },
  }),
],Type: 'npm' | 'yarn' | 'pnpm'
Name of package manager to use for installing dependencies.
Type: Object
Package manager related options.
Type: Array
Provide custom arguments to use with package manager.
plugins: [
  new InstallPlugin({
      packageManager: {
        type: 'npm',
        options: {
          arguments: ['--ignore-scripts']
        }
      }
    },
  }),
],Type: Boolean
Default: false
Install as development dependencies.
plugins: [
  new InstallPlugin({
      packageManager: {
        type: 'npm',
        options: {
          dev: true,
        }
      }
    },
  }),
],Type: Boolean
Default: false
Reduce the amount of console logging.
plugins: [
  new InstallPlugin({
      packageManager: {
        type: 'npm',
        options: {
          quiet: true,
        }
      }
    },
  }),
],Type: Boolean
Default: true
Show a prompt to confirm installation.
plugins: [
  new InstallPlugin({
      prompt: true,
    },
  }),
],-  Works with webpack 
^v5.0.0. -  Auto-installs 
.babelrcplugins & presets. -  Supports both ES5 & ES6 Modules.
(e.g. 
require,import) -  Supports Namespaced packages.
(e.g. 
@cycle/dom) -  Supports Dot-delimited packages.
(e.g. 
lodash.capitalize) -  Supports CSS imports.
(e.g. 
@import "~bootstrap") -  Supports webpack loaders.
(e.g. 
babel-loader,file-loader, etc.) -  Supports inline webpack loaders.
(e.g. 
require("bundle?lazy!./App") -  Auto-installs missing 
peerDependencies. (e.g.@cycle/corewill automatically installrx@*) -  Supports webpack's 
resolve.alias&resolve.rootconfiguration. (e.g.require("react")can alias toreact-lite) 
Please take a moment to read our contributing guidelines if you haven't yet done so.
