compress-shader-loader
v1.0.0
Published
A webpack loader that removes comments and excess whitespace and then inlines the resource into the bundle
Downloads
115
Maintainers
Readme
Compress Shader Loader
This loader was designed to aid in development with the DeltaV framework. It allows for shader code and fragments to be written into separate files and then inlined into the bundle for your project.
Installation and Use
To install simply:
npm install compress-shader-loader
This example will load .fs and .vs files and inline their contents into your bundle:
{
"modules": {
"rules": [
{ "test": /\.[fv]s$/, "use": ["shader-compress-loader"] },
]
}
}
Recommendations
I would recommend using raw-loader
to inline your shader files in development mode
and use this loader for production. Something like this:
...
{ test: /\.[fv]s$/, use: IS_PRODUCTION ? ['shader-compress-loader'] : ['raw-loader'] },
...
This will help you have a MUCH more useful debugging experience.