You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Angular 14迁移后发布包报错:Ivy全编译模式不允许发布

解决Angular 14发布时Ivy全编译模式报错问题
  • 修改项目配置文件
    打开项目根目录的angular.json,找到对应package/framework的build配置节点,在options或production配置中添加partialIvy: true:

    "architect": {
      "build": {
        "options": {
          "aot": true,
          "partialIvy": true
        },
        "configurations": {
          "production": {
            // 若生产配置单独设置,需确保这里也包含partialIvy: true
          }
        }
      }
    }
    
  • 清理旧构建产物
    删除已生成的dist目录:

    # Linux/macOS
    rm -rf dist
    
    # Windows
    rd /s /q dist
    
  • 重新构建生产包
    执行原构建命令重新生成产物:

    ng build <package/framework> --configuration production
    
  • 验证编译模式
    检查dist目录下目标包的package.json,确认存在"_processed_by_ivy": "partial"字段,说明已启用Ivy部分编译模式,此时即可正常发布。

内容的提问来源于stack exchange,提问作者up6616

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.10 20:40:30