Error when trying to lazy load feature modules using angular-cli with webpack

后端 未结 4 649
旧时难觅i
旧时难觅i 2020-12-31 18:49

Hi I\'m trying to use angular-cli with webpack (+productivity) to build my angular2 app but I\'m having issues when trying to lazy load modules which were working with versi

4条回答
  •  情书的邮戳
    2020-12-31 19:47

    Angular-cli changed the build system between beta.10 and beta.14, from SystemJS to Webpack.

    I tried using lazy loading with angular-cli(beta.17) and it worked for me.

    As per my understanding,

    SystemJs - we need to give full path for lazy loading Ex: ./app/dashboard/dashboard.module#DashboardModule

    Webpack - we need to give relative path for lazy loading Ex: ./dashboard/dashboard.module#DashboardModule

    Note : Don't forget to restart the server to see the changes reflecting.(ng serve)

    This minor observation fixed my issue. Please see if this is useful or correct me on anything.

提交回复
热议问题