是否有可能使用angular-cli块和延迟加载scripts.bundle?
问题描述:
我有一些漂亮的第三方javascripts,我在的中加入 angular-cli.json
。我的scripts.bundle.js
文件目前在7Mb左右,我希望能够像我对模块所做的那样将它分割为块和延迟加载。是否有可能使用angular-cli块和延迟加载scripts.bundle?
有没有可能?
答
您可以使用延迟加载,角提供chargue在其模块的需求,使用loadChildren
+0
我已经在使用'loadChildren',但'scripts.bundle.js'是模块独立的,并且在初始页面加载时加载。 – Burjua
我觉得这已经回答了在现有的问题:https://stackoverflow.com/questions/44200434/in-angular -cli-how-does-the-lazy-attribute-work-to-load-global-libraries –