【问题标题】:Nativescript's AOT Compilation succeeds - but still the `Compiler` package included?Nativescript 的 AOT 编译成功 - 但仍然包含 `Compiler` 包?
【发布时间】:2018-04-24 15:22:08
【问题描述】:

我正在调用:

npm run ns-bundle --android --build-app --uglify

确实成功了(这里是the complete log)。

如果我导航到report 文件夹(webpack-bundle-size-analyzer 创建) - 我会看到这两个文件:

打开html file显示:

如您所见 - @angular 的编译器仍然存在!!!

问题

1) 为什么编译器还在? (AOT 应该删除它)。如何删除它?
2) 如果我将鼠标悬停在 bundle.js 部分,它会显示解析后的大小。那么什么是统计/解析大小?


其他信息:

我必须说,当我在文件系统中搜索 bundle.js 时 - 我看到两个文件:

还有第二个:


webpack.config.jsonhttp://jsbin.com/varetibaya/1/edit?html
package.jsonhttp://jsbin.com/sajifojuki/edit?html
ma​​in.aot.file > : http://jsbin.com/jimonurama/edit?html
ts.config.aot : http://jsbin.com/tatahesoma/edit?html

【问题讨论】:

  • 好像在某处使用过。尝试调试你的包。例如,尝试检查是否调用了 compileModuleAndAllComponentsAsync(或来自 jit 编译器的其他内容)
  • @yurzui - It does being called。那么这是什么意思 ?那个 AOT 不工作?或者是吗?我希望不会在图中看到@compiler
  • JitCompilerFactory在某处提供
  • 确保platformNativeScript().bootstrapModuleFactory(AppModuleNgFactory);是起点
  • github.com/NativeScript/nativescript-angular/blob/master/… Nativescript 覆盖了这些服务 但也许它只适用于动态平台NativeScriptDynamic。我没用过

标签: angular webpack nativescript angular2-aot nativescript-angular


【解决方案1】:

@yurzui 发现了问题。

改变:

import {RouterExtensions} from "nativescript-angular";

import {RouterExtensions} from "nativescript-angular/router";

现在 - 包中没有编译器。

(非常感谢。)。

【讨论】:

    猜你喜欢
    • 2013-05-23
    • 2013-11-10
    • 2016-11-20
    • 2023-03-25
    • 1970-01-01
    • 1970-01-01
    • 2021-01-16
    • 2017-03-28
    • 2017-07-03
    相关资源
    最近更新 更多