Monorepo-examples and HMR
I'm new to monorepos and tried the router-monorepo-react-query-example.
Is it possible to get HMR when changing the components in post-feature-package?
4 Replies
noble-gold•7mo ago
cc @Nicolas Beaussart
exotic-emerald•7mo ago
It's possible, but you need to have no build step between libs and app, that means having the .ts reference in the package.json of the feature lib
That comes with tradeoff, you'd need to have the same vite / ts / third parties libs across the monorepo
provincial-silverOP•7mo ago
Ah, ok. Thanks or the answer.
deep-jade•7mo ago
Not familiar with
router-monorepo-react-query-example
but I have a monorepo project that I am building with a web client using tanstack query/router/start.
Using pnpm and workspace dependencies and package.json exports with HMR and no build step.
so my web project that depends on other monorepo packages (like component libraries) looks like
Then in sygaldry for example, which is my component library I have
because of how pnpm works (hard links), changes inside of a workspace dependency get updated in the parent projects node_modules, so no need for something like build:watch to trigger changes
HMR just picks up the changes automatically