更改 angular-errors.log 的输出位置
Change output location of angular-errors.log
我 运行 ng build
在一个 Docker 容器中,我得到一个失败的构建并向 "See /tmp/ng-LHvuYx/angular-errors.log"
提出建议
我看不到该文件,因为一旦构建过程完成,容器就会停止。
有没有办法告诉 ng build
将 angular-errors.log 放入当前工作目录(或我选择的任何目录)?我意识到我可以将 /tmp 映射到容器中,但我希望方便地让 angular-errors.log 也出现在我当前的工作目录中。
还没有。
但是您可以在执行构建之前为 OS 临时目录设置路径,例如:
set TEMP=C:\myAngularTemp && ng build
据我在 angular-cli 源中看到的 angular 10.[=26 所见,我还没有找到将其直接传递给 angular-cli 的可能性=] 虽然看起来有点准备好了:
https://github.com/angular/angular-cli/blob/10.0.x/packages/angular/cli/utilities/log-file.ts
https://github.com/angular/angular-cli/search?q=logPath&unscoped_q=logPath
let logPath: string | undefined;
我遇到了同样的问题。如果您需要阅读 angular-errors.log
文件,您可以使用类似这样的方式将其内容打印到输出中
cat $(find / -name "angular-errors.log")
我 运行 ng build
在一个 Docker 容器中,我得到一个失败的构建并向 "See /tmp/ng-LHvuYx/angular-errors.log"
我看不到该文件,因为一旦构建过程完成,容器就会停止。
有没有办法告诉 ng build
将 angular-errors.log 放入当前工作目录(或我选择的任何目录)?我意识到我可以将 /tmp 映射到容器中,但我希望方便地让 angular-errors.log 也出现在我当前的工作目录中。
还没有。
但是您可以在执行构建之前为 OS 临时目录设置路径,例如:
set TEMP=C:\myAngularTemp && ng build
据我在 angular-cli 源中看到的 angular 10.[=26 所见,我还没有找到将其直接传递给 angular-cli 的可能性=] 虽然看起来有点准备好了:
https://github.com/angular/angular-cli/blob/10.0.x/packages/angular/cli/utilities/log-file.ts
https://github.com/angular/angular-cli/search?q=logPath&unscoped_q=logPath
let logPath: string | undefined;
我遇到了同样的问题。如果您需要阅读 angular-errors.log
文件,您可以使用类似这样的方式将其内容打印到输出中
cat $(find / -name "angular-errors.log")