Dynamic imports vs. static builds #5323
Unanswered
jpommerening
asked this question in
Q&A
Replies: 1 comment
-
I'm reworking that for 3.4.0, with the CDN is fast, because of cache, but with custom builds this could not be true. I could take time to fix this, if you don't need some of the 3.3.0, you can go back to 3.2.x version, that is not using dynamic imports |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
I had a lot of fun playing with tsParticles the past few days :)
However, now I'm starting to bundle my setup for production and I'm having difficulties with the dynamic imports.
I'm using Rollup via Vite with no custom configuration (yet).
My code is importing from
@tsparticles/engine
,@tsparticles/basic
and@tsparticles/interaction-particles-links
:Rollup generates output files for all the internal dynamic imports (which I assume is according to plan):
Do you know if there's a way to statically package what's needed into a single bundle, to not have so many HTTP requests on initial load?
Is something like that planned, maybe?
I know that the exact modules that are required depend on the options that I pass to tsParticles, which is probably why the dynamic imports were added in the first place, as to not load everything at once.
So I probably have to live with some unnecessary code.
But is it possible at all?
I tried Rollup's
inlineDynamicImports
option, but then I can't have any chunks at all, which is not so nice either…Thanks :)
Beta Was this translation helpful? Give feedback.
All reactions