scarlett-glslify-loader

1.0.3 • Public • Published

glslify-loader

experimental

glslify loader module for webpack.

Installation

Generally, you'll want to use this alongside webpack's raw-loader module:

npm install --save glslify-loader raw-loader

Alternatively, using yarn:

yarn glslify-loader raw-loader

Usage

NPM

Documentation: Using Loaders

Once installed, you should be able to require your shaders like so to have them bundled at build time:

var source = require('glslify-loader!raw-loader!./my-shader.glsl')

Configuration

Alternatively, you may apply these loaders automatically to all .glsl, .frag and .vert files by adding some additional configuration:

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

Contributing

See stackgl/contributing for details.

License

MIT. See LICENSE.md for details.

Dependencies (1)

Dev Dependencies (8)

Package Sidebar

Install

npm i scarlett-glslify-loader

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

143 kB

Total Files

6

Last publish

Collaborators

  • apidcloud