How to Speed up the First time loading time Angular 6 Application

前端 未结 4 1457
遥遥无期
遥遥无期 2021-02-01 10:48

I have created Angular Application in single module fully, after final deploy files are more than 8 Mb so for First time loading time is too slow,

i have tried with -

4条回答
  •  长发绾君心
    2021-02-01 11:22

    Always use latest versions of angular. Do code splitting. Lazy loading the modules reduces your initial bundle size. Remove unused imports. Try to avoid bloated third party libraries. Proper segregation of functionalities into separate modules.

    Advanced: AFter doing all of the above, if you still want to reduce your bundle size. Try Using bazel for build process. https://blog.mgechev.com/2018/11/19/introduction-bazel-typescript-tutorial/

    More Advanced: Still you want to reduce your bundle size. Wait for Angular Ivy(public release).

提交回复
热议问题