我的应用程序非常慢,直到在浏览器上运行时加载完成(我不敢谈论移动uhhhh 10-15秒)是的,我做ng build --prod
并且它仍然很慢。
因此,使用angular cli beta 16,我尝试新标志--aot 我得到了很多导入和声明错误:
0% compilingUnexpected value 'FileDropDirective' declared by the module 'AppModule'
Error: Unexpected value 'FileDropDirective' declared by the module 'AppModule'
at C:\Users\...\node_modules\@angular\compiler\bundles\compiler.umd.js:14174:33
at Array.forEach (native)
然后只是为了好玩我评论3个libs,它给我这个错误,只是为了看看它是否会继续编译......不!我收到另一个错误:
10% building modules 6/12 modules 6 active ...ode_modules\style-loader\addStyles.jsSyntaxError: Unexpected token ILLEGAL
at WebpackResourceLoader._evaluate (C:\Users\...\node_modules\@ngtools\webpack\src\resource_loader.js:75:24)
如何实现?感谢
答案 0 :(得分:1)
版本2.0.0的angular2-mdl hase今天发布了。现在支持AOT。
答案 1 :(得分:0)
我认为MdlModule
和Angular2DataTableModule
是一些外部库。如果他们的每个Angular文件都没有包含*.metadata.json
,那么您的AoT编译就无法知道他们做了什么。你不能做太多,只提交一个问题,以便他们更新他们的libs以与AoT兼容。
但对于你的FileDropDirective
,如果没有代码我就无法分辨。