glsl loader for webpack working with chunks (inspired by ShaderLoader from cabbibo)
Switch branches/tags
Nothing to show
Clone or download
Latest commit 8f29ae3 Jul 24, 2017
Failed to load latest commit information.
.gitignore Fix options for Webpack 2 Jul 24, 2017 Update Jul 24, 2017
index.js Fix options for Webpack 2 Jul 24, 2017
package.json Fix options for Webpack 2 Jul 24, 2017

Glsl loader for webpack

Glsl loader for webpack2 & webpack3. It support chunks & inspire by ShaderLoader

Getting started


npm install shader-loader --save-dev

Config webpack:

module: {
	rules: [
        test: /\.(glsl|vs|fs)$/,
        loader: 'shader-loader',
        options: {
          glsl: {
            chunkPath: resolve("/glsl/chunks")

You can now require your glsl files:

var vertexShader = require("shader.vs");
var fragmentShader = require("shader.fs");

if you use $xxx in your shader its replace by the content of xxx.glsl, for example:

void main(void) {
	$snoise //replace by chunks/snoise.glsl

Learn more about loaders & webpack: