V
V
Vlad2022-01-28 15:36:59
JavaScript
Vlad, 2022-01-28 15:36:59

Is it possible to create a SPA with dynamic loading of JavaScript animation files?

I want to create a SPA in pure JavaScript using the GSAP library and the Webpack module builder.
Page data is stored in other files, and is pulled by Ajax on click.
The question is how to organize pulling animation js-files corresponding to these pages?
It would not be desirable to push them in one entry point.
Are there any solutions that allow you to pull up certain js files corresponding to certain pages?
Or is it nonsense and shove everything into one entry point and not take a steam bath?
What if the bundle file exceeds the recommended size?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2022-01-28
@Vextor-ltd

https://webpack.js.org/guides/lazy-loading/ https
://www.fabrizioduroni.it/2020/06/02/dynamic-i...
Google dynamic import and lazy loading
loading together with the preloader (divided into pieces, then loaded in the background everything in advance), otherwise the delay is large

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question