I've tried to use ngtools/webpack for AOT compilation. It worked fine until I tried to create lazy loaded routes. The error I get - Error: Cannot find module './components/dashboard/dashboard.module.ngfactory'.
. In the dist folder I'm also missing chunks for lazy loaded bundles.
I have no idea what I do wrong, I've spent a lot of time to fix this. I've created a simple project tour of heroes
in this repo, where I get the error described above. The branch in repo is angular-aot-refactor
. When you get to the root of the app - simply npm install
and npm run dev:aot
.
The question is - what I do wrong so lazy loading does not work?
Thanks in advance for help!