Webpack stats.json 文件为空 [英] Webpack stats.json file is empty
本文介绍了Webpack stats.json 文件为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我运行以下命令时,我得到一个空的 stats.json 文件:
When I run the following command I get an empty stats.json file:
webpack --env production --profile --json --output-filename stats.json
推荐答案
我发现当我为开发和生产环境使用不同的 Webpack 配置文件时,我需要包含 --config
选项在命令中:
I discovered that as I was using different Webpack config files for dev and production environmnets, I needed to include the --config
option in the command:
webpack --env production --profile --json --config='webpack.config.prod.js' --output-filename='stats.json'
这篇关于Webpack stats.json 文件为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文