UstymUkhman / vite-plugin-glsl

:spider_web: Import, inline (and compress) GLSL shader files :electric_plug:
https://www.npmjs.com/package/vite-plugin-glsl
MIT License
321 stars 21 forks source link

Add included chunks to moduleGraph #34

Closed brunoimbrizi closed 1 year ago

brunoimbrizi commented 1 year ago

The intention behind this PR is to avoid a server.restart() when a shader file is updated - as discussed on https://github.com/UstymUkhman/vite-plugin-glsl/issues/31

The implementation proposed here follows Vite's plugin/css.

Here's an online example: https://stackblitz.com/edit/vitejs-vite-7cujfh?file=glsl%2Finclude-B.glsl