Closed fnick851 closed 3 years ago
This is "kind of" expected behavior because:
renderWaterScene
in a Vue componentrenderWaterScene
creates dat-gui as a side-effect-on-importWhat you should do is to avoid on-import side-effects in files that export code being used in Vue components - i.e. separate dat-gui setup logic from functions like renderWaterScene
.
Describe the bug
Vite's hot reload will add a new instance of dat.gui each time to the DOM. (I am actually not 100% sure if this is a bug or it is expected behavior.)
Reproduction
https://github.com/fnick851/vite-shader-water/tree/datgui-issue (on
datgui-issue
branch)System Info
vite
version: 2.0.0-beta.45Logs (Optional if provided reproduction)
vite
orvite build
with the--debug
flag.