Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【Angular】包的加载速度优化 #151

Open
deepthan opened this issue Sep 17, 2021 · 0 comments
Open

【Angular】包的加载速度优化 #151

deepthan opened this issue Sep 17, 2021 · 0 comments

Comments

@deepthan
Copy link
Owner

问题: angular的包太大了,导致加载时间很长,怎么优化呢?

1. 懒加载 + build 优化

  • 懒加载
    模块配置懒加载:把应用分成很多个小模块,每次只加载对应的模块。
  • 预加载
    模块配置预加载:加载完懒加载模块之后再把其他模块加载进来。
  • build优化
    aot优化

2. web容器开启gzip

3. 参考网站ngx-admin进行优化

ngx-admin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant