[Webpack 2] Validate your Webpack config with webpack-validator

It’s quite common to make a mistake while developing your webpack configuration. A simple typo can cost you hours of development time. With webpack-validator, you can save yourself a ton of time by validating that your webpack configuration is free of common mistakes.

install: 

npm i webpack-validator --save-dev

Scripts:

    "validate": "npm-run-all --parallel validate-webpack:* lint test --serial check-coverage",
    "validate-webpack:dev": "webpack-validator webpack.config.js --env.dev",
    "validate-webpack:prod": "webpack-validator webpack.config.js --env.prod",

When you have something wrong in webpack.config.js, it will tell you.

Check: Link

原文地址:https://www.cnblogs.com/Answer1215/p/5605689.html