compress-shader-loader

1.0.0 • Public • Published

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.

Package Sidebar

Install

npm i compress-shader-loader

Weekly Downloads

46

Version

1.0.0

License

MIT

Unpacked Size

5.15 kB

Total Files

3

Last publish

Collaborators

  • diniden