$ cnpm install npm-install-webpack-plugin-cn
Speed up development by automatically installing & saving dependencies with Webpack.
Seamlessly works with:
require
, import
)@import "~bootstrap"
)babel-loader
, file-loader
, etc.)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!
$ npm install --save-dev npm-install-webpack-plugin
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
...
}),
],
MIT License 2016 © Eric Clemmons
Copyright 2013 - present © cnpmjs.org