我一直在寻找我的问题的解决方案,但没有运气。所以也许有人能帮我一下。
我正在从ng 4.4.4升级到5.0.1,在JIT模式下一切似乎都可以正常工作,但是当我尝试编译到AOT模式时,它不能工作。
该错误指出无法找到模块app.module.ngfactory,这似乎是有意义的,因为由于某种原因,它没有被生成。
以下是我的文件:
main-aot.ts
import { platformBrowser } from '@angular/platform-browser';
import { enableProdMode } from '@angular/core';
import { AppModuleNgFactory } from '../Scripts/dist/aot/tsScripts/app.module.ngfactory';
enableProdMode();
platformBrowser().bootstrapModuleFactory(AppModuleNgFactory);tsconfig-aot.json
{
"compilerOptions": {
"target": "es5",
"module": "es2015",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [
"es2015",
"dom"
],
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"outDir": "Scripts/dist/aot",
"typeRoots": [
"node_modules/@types/"
]
},
"files": [
"tsScripts/app.module.ts",
"tsScripts/main-aot.ts"
],
"angularCompilerOptions": {
"genDir": "Scripts/dist/aot",
"skipMetadataEmit": true,
"preserveWhitespaces": false
}
}我用来编译的命令是:
ngc -p tsconfig-aot.json && rollup -c rollup-config.js有谁可以帮我?
提前感谢
发布于 2017-11-15 20:47:10
最后,我移动了我的项目结构,使用angular-cli,一切都正常了。
https://stackoverflow.com/questions/47284137
复制相似问题