dependency-check-webpack-plugin
Check if there are new dependencies in package.json that have not been installed, and than automatically execute the install command
Install
npm i --save-dev dependency-check-webpack-plugin
yarn add dependency-check-webpack-plugin -D
Usage
webpack.config.js
const { DependencyCheckWebpackPlugin } = require("dependency-check-webpack-plugin");
module.exports = {
entry: 'index.js',
output: {
path: __dirname + '/dist',
filename: 'index_bundle.js'
},
plugins: [
// give some options
new DependencyCheckWebpackPlugin({})
]
}
Options
Name | Type | Required | Default | Description |
---|---|---|---|---|
skip | boolean | false | false | skip plugin execution |
installCommand | string | false | 'yarn install' | install command in your project |
packageJSONPath | string | false | ${executeDir}/package.json |
package.json path in your project |
nodeModulesPath | string | false | ${executeDir}/node_modules |
node_modules path in your project |