背景
为了加快我的角度7应用程序的感知性能,我试图在我的应用程序中添加一个app shell,并使用angular universal预呈现该shell。为此,我正在关注这些steps。
问题
当我从上面的链接(ng run my-app:app-shell
)执行步骤3中的命令时,该过程失败,因为看起来angular universal正在尝试使用节点环境构建我的整个应用程序,并且我的应用程序的某些部分与角度不兼容普遍。我不需要渲染整个应用程序或与angular universal兼容,只需要app shell组件。
问题
ng run my-app:app-shell
命令中仅包含要预渲染的应用程序shell?回答你的第二个问题。我在这里找到了答案:https://github.com/angular/angular-cli/issues/11478#issuecomment-423825620
ng run my-app:app-shell -c production