GLSL, especially when writing several similar shaders to minimize runtime branching, is prone to code duplication.
Fortunately, someone has written a glslify transform called glslify-import. It extends glslify #pragma directives with support for import(path). Imported source still goes through the glslify transform pipeline.
In order to use glslify-import with Webpack, we'll need to switch to a slightly modified version of glslify-loader that includes support for query parameters.
GLSL, especially when writing several similar shaders to minimize runtime branching, is prone to code duplication.
Fortunately, someone has written a glslify transform called
glslify-import
. It extends glslify#pragma
directives with support forimport(path)
. Imported source still goes through the glslify transform pipeline.In order to use
glslify-import
with Webpack, we'll need to switch to a slightly modified version ofglslify-loader
that includes support for query parameters.