[英]Angular ng build does not produce dist folder
我很沮丧,因为我运行了 ng build 但它没有在项目文件夹中生成 dist 文件夹。 我对其他项目没有问题。 奇怪的是编译器没有给出任何错误。 有人可以检查我的项目并告诉原因吗? https://github.com/vugar005/报告亲切的问候
我已经看到您的存储库,并且我认为问题出在您的“ .angular-cli.json”文件上。 在第9行中,将outDir指定为“ ../MHS”,它将结果生成到“ ../MHS”文件夹中,而不是“ dist”文件夹中。
为了解决您的问题,您可以将outDir从“ ../MHS”更改为“ dist”。
希望它有效! :) -mczal
这不适用于此特定案例,但它可能会帮助其他遇到相同问题的人。
在 angular.json 中:
projects.<project name>.architect.build.configurations.<configuration>.tsconfig
被设置为一个不存在的文件。 将其更改为正确的文件解决了我的问题。
{
/* other configuration */
"projects": {
/* other configuration */
"my-library": {
/* other configuration */
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"project": "projects/my-library/ng-package.json"
},
"configurations": {
"production": {
/* this used to be a file that did not exist */
"tsConfig": "projects/my-library/tsconfig.json"
},
"development": {
/* this used to be a file that did not exist */
"tsConfig": "projects/my-library/tsconfig.json"
}
}
}
}
}
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.