Proper way of handling lazy loading in DEV #21026
Unanswered
Gabilabrebi
asked this question in
Q&A
Replies: 1 comment
-
|
Anyone experiencing same troubles? |
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
Uh oh!
There was an error while loading. Please reload this page.
-
Hello
I'm looking for help on how to handle lazy loading properly in dev. My lazy loading works 100% properly in prod, but i've some weird stuff happening in dev. Cojntext : SPA, monorepo, using vite as middleware, Full, TS, no framework, custom router.
Here is how i create routes and make vite aware of them
And here is how i route dynamically
As you can see i already had to make prod/dev conditions here to make it work.
In production, after initial loading, i also preload all module in idle using this
But as you can see i also had to create conditional rule here, because if i don't, modules are loaded twice.
This setup works like 99% of time, but i sometimes have weird stuff hapening like :
I'm not sure how to fix all this and make it flawless for both front and dev. Any help would be appreciated :)
Beta Was this translation helpful? Give feedback.
All reactions