gpt4 book ai didi

Angular 通用 : How to create an app shell and only pre-render the shell?

转载 作者:行者123 更新时间:2023-12-05 07:27:03 27 4
gpt4 key购买 nike

背景

为了加快我的 angular 7 应用程序的感知性能,我正在尝试向我的应用程序添加一个应用程序外壳,并使用 angular universal 预渲染该外壳。为此,我正在关注这些 steps .

问题

当我从上面的链接(ng run my-app:app-shell)执行步骤 3 的命令时,该过程失败,因为看起来 angular universal 正在尝试构建我的整个应用程序使用节点环境,并且我的应用程序的某些部分与 Angular 通用不兼容。我不需要渲染整个应用程序或与 angular universal 兼容,只需要应用程序外壳组件。

问题

  1. 如何在 ng run my-app:app-shell 命令期间只包含要预呈现的应用程序外壳?
  2. 此外,该命令会在开发模式下构建应用程序的其余部分。我该如何触发产品构建?

最佳答案

回答你的第二个问题。我在这里找到了答案: https://github.com/angular/angular-cli/issues/11478#issuecomment-423825620

ng run my-app:app-shell -c production

关于 Angular 通用 : How to create an app shell and only pre-render the shell?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54069219/

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