-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add vue to resolve.dedupe
#1356
Conversation
I don't think |
Multiple instances of vue may cause failure in development and result in multiple chunks in the bundle.
So does vitepress support vite config out of the box? (One may would like to use vitepress together with other component libraries.) |
Yeah, I understood that part. But according to Vite's docs, that doesn't work on SSR + ESM builds (<-- that's what we are using here). One needs to use CJS mode for SSR for it to work. And regarding Vite config, yes it is supported. |
Well I see. So should I just remove |
I think we should simply discourage users from using different versions of Vue...? What is the reason why you can't update the Vue version? |
@kiaking It is not about updating the vue version. Adding dependencies in a composite project may result in multiple instances of vue, something like |
So, seems like Vite 4 still has same behavior at the moment. Maybe we should simple document about this issue...? It might be simpler. @brc-dd Do you happen to have any news on this topic? 👀 |
@shigma Evan is currently looking into this problem. It's also an issue in Nuxt as well. While adding this option to Vite config is one way of solving it, but we're trying to fix the issues by looking into the problem deeper. We're trying gather as much as reproduction here to see the actual cases. If you have reproduction code, please share. It would be super helpful 🙇 |
Maybe only dedupe for client-side builds? |
7ad4a4e
to
f0d3082
Compare
vue plugin already dedupes this for client builds now - https://github.com/vitejs/vite-plugin-vue/blob/69fb8c811d8fdbc7bdc968033834ddede59ee885/packages/plugin-vue/src/index.ts#L163 |
Developers who wants to extend the theme may use libraries depending on different versions of vue, causing client errors. Adding vue to
resolve.dedupe
can avoid such conditions.