2017-08-30 31 views
0

我有一个test project,我尝试使用AoT编译。 随着last commit我已经添加了打字稿的路径映射:角度。 AOT。遇到的错误静态解析符号值。无法解析

"paths": { 
    "home/*": ["./app/home/*"] 
}, 

用法:

import {HomeComponent} from 'home/home.component'; 

JIT编译工作正常,但试图使用AOT时:

./node_modules/.bin/webpack --config webpack.config.aot.js 

我得到下一个错误:

ERROR in Error encountered resolving symbol values statically. Could not resolve home/home.component relative to /home/sergey/projects/aot_test/src/app/app.module.ts., resolving symbol AppModule in /home/sergey/projects/aot_test/src/app/app.module.ts, resolving symbol AppModule in /home/sergey/projects/aot_test/src/app/app.module.ts

PS:我使用Angular版本4.1.3,因为它是我们项目的当前版本。我试图更新separate brunch中的所有软件包,但没有帮助,错误依然存在。

PSS:在最后一次提交AoT编译工作之前。

+0

你可以发布你的appModule? –

+0

提供更多相关的代码 – ricky

+0

@VolodymyrBilyachat,看[这里](https://github.com/WiseBird/Angular-Aot-Example/blob/master/src/app/app.module.ts) –

回答

0

我以前在tsconfig不正确的路径,应该改为:

"paths": { 
    "home/*": ["./src/app/home/*"] 
}, 

JIT编译工作,因为它忽略了TS错误,不像AOT。

相关问题