Vite dev server watch/HMR in a monorepo with Vite libraries #9979
Unanswered
segevfiner
asked this question in
Q&A
Replies: 1 comment
-
One source of problems here seems to be vuejs/language-tools#1815, which makes "type checking" in VS Code not work in |
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
-
I'm trying to figure out how to use the Vite dev server in a pnpm monorepo that will have a bunch of Vite library packages. For now I can get a library package to build with a config like:
vite.config.ts
package.json
And this will work correctly if I build the library before building its consumers using
pnpm build
/vite build
. But this means that such libraries will not benefit from Vite's dev server compilation on change and HMR.I wonder if there is any proper way to handle this? Using
resolve.aliases
is a bit nasty as that will not respect any config from the library'svite.config.ts
/tsconfig.json
, and doesn't help with TypeScript that gets quite confused from such a setup,g etting TypeScript project references to play along with Vite for this scenario seems quite involved...Can anyone provide any assistance here on how this should be setup properly? Or should I resign to
vite build
in libraries?Beta Was this translation helpful? Give feedback.
All reactions