npm的自定义脚本别名"webpack":"webpack --config webpack.config.js --progress --display-modules --colors --display-reasons"
采用npm run webpack 运行后出现如下错,
原因是:--display-modules --colors --display-reasons 这三个参数 未能识别请看图一
报如下错误:
× 「webpack」: Flags were specified that were not recognized:
--display-modules Not sure what you mean there
--colors Not sure what you mean there
--display-reasons Not sure what you mean there
本人用了最low的方法测试,也找到了最low的解决方案,但我希望能得到一个最好的解决方案。
1,把三个参数去掉直接然后运行,打包成功,如图二
2,直接运行长脚本,打包成功,如图三。
![图一](https://img-ask.csdn.net/upload/201809/07/1536321374_578616.jpg)
![图二](https://img-ask.csdn.net/upload/201809/07/1536321394_825625.png)
![图三](https://img-ask.csdn.net/upload/201809/07/1536321417_422983.png)