Import GLSL code with glslify (a node.js-style module system for GLSL).
import frag from './shaders/frag.glsl'
console.log(frag)
npm install --save-dev snowpack-plugin-glslify
yarn add -D snowpack-plugin-glslify
// snowpack.config.js
import glslify from 'snowpack-plugin-glslify'
export default {
// ...
plugins: [
'snowpack-plugin-glslify'
]
}
Currently, the only supported option is compress. If you need more, shoot me a PR.
plugins: [
['snowpack-plugin-glslify', { "compress": false }]
]
Released under the MIT license.