gpt4 book ai didi

angular-cli:默认使用 ng serve 进行 AoT 编译

转载 作者:太空狗 更新时间:2023-10-29 18:03:04 24 4
gpt4 key购买 nike

在 Angular CLI 中,ng serve 使用 JiT,并且需要标志 --aot 才能使用 AoT 编译。

是否可以让 ng serve 默认使用 AoT,并且仅在传递 --aot=false 标志时才使用 JIT?

最佳答案

编辑:从angular 9开始,开发环境默认开启aot编译(see documentation)

在 Angular 6 中,您可以为 serve 目标指定默认选项,因此您可以在该部分添加 aot: true 并且默认为 ng serve 将使用 aot

"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "project:build",
"aot": true
},
"configurations": {

关于angular-cli:默认使用 ng serve 进行 AoT 编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51188652/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com