Moving libraries outside vendor.js to reduce its size

Hi,

My vendor.js after I build it with flags: --minifyjs --minifycss --release --aot --prod --optimizejs is 3.8MB. As my app is a PWA (browser based) it takes quite some time for devices running on slow networks to be able to start using the website.

I used source-map-explorer to see which libraries are bloating up the vendor.js file and I see that two libraries are playing a big role: survey.angular.js.pre-build-optimizer.js (685Kb) and ChartNew.js (300Kb).

My question is: is there a way I can load these two libraries later on when I need them instead of in the beginning inside vendor.js? My idea is to reduce vendor.js to the minimum I need to start the app, and other libraries I can load later on, when needed.

Thanks