Skip to content

Nek/webpack-lygia-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webpack-lygia-loader

A webpack loader that enables seamless integration of Lygia shaders by resolving #include directives at build time. This eliminates runtime network requests for shader dependencies and improves performance. The loader handles both local file includes and remote Lygia library imports with automatic caching.

Installation

npm install webpack-lygia-loader

Usage

Add to your webpack configuration:

module.exports = {
  module: {
    rules: [
      {
        test: /\.(glsl|vs|fs|vert|frag)$/,
        exclude: /node_modules/,
        use: [
          'raw-loader',
          'webpack-lygia-loader'
        ]
      }
    ]
  }
}

Then in your shaders you can include Lygia modules:

#include "lygia/math/const.glsl"
#include "lygia/space/ratio.glsl"

Features

  • Resolves Lygia includes at build time
  • Caches downloaded files
  • Supports local file includes
  • Works with Next.js and other webpack-based bundlers

License

MIT

About

A webpack loader for Lygia GLSL library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors