我正在尝试为我的 Angular 6 应用程序生成 stats.json 文件。下面的事情我已经尝试过,但根本没有生成文件。我的系统需要有 “npm 运行”在每个 angular cli 命令之前。
但是仍然没有生成 stats.json 文件,我想使用 webpack 包分析器读取该文件。
欢迎在这方面提供任何帮助、建议或更正。
下面是我的 package.json 中的脚本。
“脚本”:{
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"gulp": "gulp",
"bundle-report": "webpack-bundle-analyzer dist/stats.json",
"stats": "webpack-bundle-analyzer dist/stats.json"
},
最佳答案
我发现我的在/dist 中。
这意味着如果您查看 git 中出现的更改,它可能会被忽略。
关于使用 --stats-json 构建 Angular 6 不生成 stats.json 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58693987/