英文:
Angular: Can someone explain ng build in reference to Angular IVY?
问题
我知道Angular IVY自Angular 9起默认使用AOT。从谷歌搜索中,我了解到:
ng build --dev使用JIT
ng build --prod使用AOT
我试图调和这两个选项,特别是第一个(使用JIT)与Ivy渲染引擎的工作方式,因为它使用AOT,似乎存在冲突?
英文:
I know Angular IVY uses AOT by default since Angular 9.
From googling, I understand that
ng build --dev uses JIT
ng build --prod uses AOT
Am trying to reconcile how these two options especially the first one (which uses JIT) works with Ivy Rendering Engine since its using AOT which seem to conflict with each other?
答案1
得分: 0
我认为你的困惑是因为不理解AOT/JIT和Ivy之间的区别。Ivy是一个渲染引擎,这意味着Ivy会接受你的模板(HTML)并将其转换为TypeScript(简单来说)。JIT/AOT是将生成的TypeScript转换为浏览器可读的JavaScript的策略。
英文:
I think your confusion is a result of not understanding the difference between AOT/JIT and Ivy. Ivy is a rendering engine, which means that Ivy takes your templates (HTML) and transforms them into TypeScript (in simple terms). JIT/AOT are strategies for transforming generated TypeScript into JavaScript that can be read by the browser.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论