Angular 5 webpack 3 aot

爱⌒轻易说出口 提交于 2019-12-03 01:07:57

It appears that @ngtools/webpack could handle bootstraping module factory itself from original main file, eg webpack entry should be : path_to_file/main.ts

and main.ts contains:

platformBrowserDynamic().bootstrapModule(AppModule);

And whole thing will be handled itself, no additional configs!

It is really amazing

I do not think the accepted answer is correct. I had the same problem and there were two reasons for my problem:

I had to include the module in my includes in tsconfig:

"include": [
  "ng/src/main/app.module.ts",
  "ng/src/main.aot.ts"
]

My include in main.aot.ts just referenced the source file but with ngfactory suffix:

import { MainModuleNgFactory } from './main/app.module.ngfactory';
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!