-
-
Notifications
You must be signed in to change notification settings - Fork 184
Description
Description
I was trying to import a Vue component from another instance of vite.
The problem lies here:
https://github.com/vitejs/vite/blob/c78e4099e502876a2ab23fd8163455d8172ff5b7/packages/plugin-vue/src/utils/descriptorCache.ts#L30
Due to how the id on the descriptor is generated it is impossible to me to change how the css-Scope/__hmrId ... will be generated resulting in a broken hmr runtime and conflicting css.
Using the isProduction flag is not viable because it disables the hmr runtime on vue components.
Suggested solution
Could we introduce another flag or an option to specify how this Id would generate?
There could be an Option that works like isProduction
to include the source
when creating the id hash
Alternative
No response
Additional context
Repro in StackBlitz: https://stackblitz.com/edit/vitejs-vite-kr3fdz?file=vite-1/index.html
If we then edit the vite-1/src/App.vue the other app gets broken because their internal _hmrId is the same.
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.