“角文件”规定:
*Ahead-of-Time (AOT), which compiles your application and libraries at build time. This is the
default since Angular 9.*因此,如果我想为生产编译我的AOT角度12应用程序,我只需要键入ng build而不添加--prod,也不需要在angular.json或Package.jsonE 210中添加特定的配置。
这是ng build命令,它位于my package.json中:
...
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"prepare": "husky install"
},
...谢谢你的帮助
发布于 2021-10-01 09:28:48
您不需要显式地包含生产构建的--prod命令,因为您使用的是最新版本的gather,即我收集的v12。
默认的angular.json文件包括一个关于生产构建的配置文件部分,您可以保留它。
https://stackoverflow.com/questions/69403158
复制相似问题