Open alvarosabu opened 1 year ago
Possible Solution https://github.com/vitejs/vite/issues/12097
I guess you can differentiate the update by checking _rerender_only
variable.
https://github.com/vitejs/vite-plugin-vue/blob/2050ad3dc568b4d051d19611aad34693e9a917ec/packages/plugin-vue/src/main.ts#L146-L164
@alvarosabu Does the above solution solve your problem?
Hi there @edison1105 the truth is that I haven't yet tried it out the solution @sapphi-red proposed. I will give it a try. Thanks
Related plugins
[X] plugin-vue
[ ] plugin-vue-jsx
Description
Hi there,
For the TresJS library, we need to dispose of 3D scene objects on HMR, the problem is that right now we have no way of differentiating whether the change came from the
<template>
or from<script>
.The problem is that this code works well when the change comes from the template, but if the change comes from the
script
tag the creation of 3D instances is loaded again, causing duplicate objects on the sceneI checked the value coming from both
vite:beforeUpdate
andvite:afterUpdate
but I don't see any info that could help me differentiate between bothSuggested solution
Maybe return a property with the origin of the change? Like so
Alternative
No response
Additional context
No response
Validations