angular - 如何在 'ng build' 之后更改 angular-cli 中的 dist 文件夹路径

标签 angular angular-cli

我想在 asp.net core 中使用 angular-cli,我需要知道如何更改 dist 文件夹的路径

最佳答案

目前更流行的方法是更新 angular.json 中的 outDir 属性(在旧版本中称为 .angular-cli.json Angular CLI 版本)。

ng build 命令参数 --output-path(或简称 -op)也仍然受支持,这很有用如果您需要多个值,可以将它们作为 npm 脚本保存在 package.json 中。

Beware: The .angular-cli.json property is NOT called output-path like the currently-accepted answer by @cwill747 says. That's the ng build argument only.

It's called outDir as mentioned above, and it's a under the apps property.

.

附言

(2017 年 12 月)

添加此答案 1 年后,有人添加了一个包含基本相同信息的新答案,并且原始发帖人将接受的答案更改为第一个包含相同信息的迟到 1 年的答案这一行。

关于angular - 如何在 'ng build' 之后更改 angular-cli 中的 dist 文件夹路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37348045/

相关文章:

angular - 在导航到另一条路线之前清除辅助路线。 @angular-4.0.2

arrays - Typescript 从对象中选择 ID

node.js - 无法扩展接口(interface) 'http.IncomingMessage' 。你的意思是 'implements' 吗?

javascript - 如何重置 Jasmine 中的 spy ?

angular-cli - Angular5 PWA 不刷新(Service Workers)

angular - 如何通过 angular-cli 配置 Angular 2 环境设置?

node.js - 如何稳定 {Node} npm 依赖系统?

node.js - Angular 4 生产部署工作流程

angular - 无法让 Angular4 使用延迟加载和动画(使用 BrowserAnimationsModule)

angular - 添加@angular/fire 到 angular 12