Replies: 2 comments 14 replies
-
Maybe Vite's warmup support can help. https://vitejs.dev/guide/performance#warm-up-frequently-used-files If you think the remix plugin is to blame you can confirm by installing vite-plugin-inspect which will show the timings of each plugin. https://www.npmjs.com/package/vite-plugin-inspect |
Beta Was this translation helpful? Give feedback.
-
Vite provides Personally, I had a problem with e2e testing where some random window refresh during navigation makes tests too flaky, so I attempted to manually setup https://github.com/hi-ogawa/ytsub-v3/blob/f5074646e1ef45e671ea2f3fe28c236239173956/vite.config.ts#L71-L75 export default defineConfig({
plugins: [
// had to disable since false-positive error during optimizeDeps discovery?
// https://github.com/remix-run/remix/pull/8267
remix().filter((plugin) => plugin.name !== "remix-dot-server"),
],
optimizeDeps: {
// add this to crawl all routes
entries: ["./app/entry-client.tsx", "./app/root.tsx", "./app/routes/**/*"],
},
}); This worked in my case, but I have a little doubt that maybe some server only dependencies leak to client due to this. I haven't tested it but I think using It would be interesting if more people try |
Beta Was this translation helpful? Give feedback.
-
Hi, I have recently migrated to Vite however the experience is not really that great. When I start my server it optimizes a bunch of dependencies which is fine. However when i navigate between pages, it optimizes more dependencies but it takes anywhere from 2s-10s. Sometimes it blocks the navigation completely and i have to click the link again, sometimes it redirects after a second but an error shows up for a second that something is not yet available (for example
@conform-to/react
tries to useuseRef
which fails for a second).Is there a way to fix it? Like force to optimize all possible dependencies beforehand? Or is it a problem in vite with remix itself?
Beta Was this translation helpful? Give feedback.
All reactions