glslify loader module for webpack.
Generally, you'll want to use this alongside webpack's
raw-loader
module:
npm install --save glslify-loader raw-loader
Once installed, you should be able to require your shaders like so to have them bundled at build time:
var source = require('glslify!raw!./my-shader.glsl')
Alternatively, you may apply these loaders automatically
to all .glsl
, .frag
and .vert
files by adding some
additional configuration:
module.exports = {
module: {
loaders: [
{ test: /\.(glsl|frag|vert)$/, loader: 'raw', exclude: /node_modules/ },
{ test: /\.(glsl|frag|vert)$/, loader: 'glslify', exclude: /node_modules/ }
]
}
}
See stackgl/contributing for details.
MIT. See LICENSE.md for details.