{"repo":"UstymUkhman/vite-plugin-glsl","free":true,"listed":false,"github":"https://github.com/UstymUkhman/vite-plugin-glsl","clone":"git clone https://github.com/UstymUkhman/vite-plugin-glsl.git","description":":spider_web: Import, inline (and minify) GLSL/WGSL/Slang shader files :electric_plug:","language":"JavaScript","stars":423,"topics":["vite","glsl","webgl","plugin","vitejs","vite-plugin","shaders","webgpu","threejs","babylonjs"],"license":"MIT","category":"game-templates","readme_excerpt":"Vite Plugin GLSL # Import, inline (and minify) GLSL/WGSL/Slang shader files Inspired by threejs-glsl-loader and vite-plugin-string, compatible with Babylon.js, three.js and lygia. Installation ## Usage ## With TypeScript ### Add extension declarations to your types in tsconfig.json : or as a package dependency directive to your global types: With Slang Shaders ### Slang shaders are not supported out of the box; however, starting from version 1.6.0 , it's quite easy to use them with this plugin. You'll need some minimal setup you can find here to copy-paste in your vite.config file. The idea is to use multiple importKeywords to include Slang shader chunks and convert the output shader to a web-friendly format (like WGSL ) by using the onComplete option and the Slang compiler. Default Options ## Example ## Will result in: Change Log ## - Starting from v1.6.0 this plugin supports onComplete callback function to customize output shaders. - Starting from v1.5.2 this plugin uses vite.transformWithOxc function when available. - Starting from v1.5.1 this plugin is fully compatible with vite^7.0.0 . - Starting from v1.5.0 this plugin supports a custom importKeyword to include shader chunks. - Starting from v1.4.0 compress option was renamed to minify and now it allows a promise callback. - Starting from v1.3.2 this plugin allows to automatically remove already imported chunks with the removeDuplicatedImports option set to true . - Starting from v1.3.1 this plugin is fully compatible w","default_branch":null,"files":null,"tree":[],"storefront":"/r/UstymUkhman","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/UstymUkhman/vite-plugin-glsl/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}