Angular Lazyload路由会生成带有前缀default〜pages的额外块文件 [英] Angular Lazyload routes generates extra chunk files with prefix default~pages

查看:106
本文介绍了Angular Lazyload路由会生成带有前缀default〜pages的额外块文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为当前正在处理的项目实现延迟加载路线.一切正常,我没有任何错误,当我进入新页面时,我还可以看到新的块文件加载.

I'm trying to implement lazy loading routes for the project I'm currently working on. everything works and I get no errors, I can also see when I go to new pages new chunk files load.

但是,除了我期望的块文件之外,cli还创建了一些带有前缀"default〜pages"的额外文件,例如

however, in addition to my expected chunk files, cli also creates few extra files with prefix "default~pages", such as

default~pages-managers--managers-module~pages-hosts-hosts-module~pa~0e1f5bc0

以及带有default~前缀的这些文件都会加载,无论我进入哪个页面. 例如,如果我在主页上,则同时看到这两者:

and these files with default~ prefix load regardless of what page I'm landing on. For example, if I'm on the home page, I see both:

pages-home-home-module

default~pages-managers--managers-module~pages-hosts-hosts-module~pa~0e1f5bc0

有人知道这些默认文件是什么以及如何清除它们吗?

does anyone know what are these default files are and how to get rid of them?

推荐答案

我无法比这个文章更好地解释:在惰性模块之间拆分或共享方法的角度代码

I can't explain better than this acticle: angular-code-splitting-or-how-to-share-components-between-lazy-modules

这篇关于Angular Lazyload路由会生成带有前缀default〜pages的额外块文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆