index.html ng build 运行 后不直接放在dist文件夹下

index.html is not directly placed under dist folder after running ng build

对于 angular 版本 6 应用程序,我 运行 命令 ng build 并成功生成了 dist 文件夹。但是我的 index.html 并不直接位于 dist 下 目录结构类似于 dist/project_name/index.html。我需要更改什么才能直接在 dist 文件夹下获取 index.html

我需要这个用于 expressjs 代码的路径,并希望它是通用的并且不包含项目名称。

谢谢!

对于 angular 6 应用程序,请尝试在您的 angular.json

中设置 "outputPath": "dist"