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

Posted Answer1215

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[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

以上是关于[Webpack 2] Validate your Webpack config with webpack-validator的主要内容,如果未能解决你的问题,请参考以下文章