3.0.3 • Published 8 months ago

@tyduptyler13/glslify-loader v3.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

glslify-loader

glslify loader module for webpack.

Installation

npm install glslify-loader

Generally, you'll want to use this alongside webpack's 'asset/source' type:

type: 'asset/source'

Usage

Documentation: Using Loaders in Webpack

Configuration file
module.exports = {
  rules: [
    {
      test: /\.(glsl|vs|fs|vert|frag)$/,
      exclude: /node_modules/,
      use: [
        'glslify-loader'
      ],
      type: 'asset/source'
    }
  ]
}
Inline

See the official webpack documentation: https://webpack.js.org/guides/asset-modules/#replacing-inline-loader-syntax

Speficy source transforms

See Glslify Source Transforms for details.

module.exports = {
  rules: [
    {
      test: /\.(glsl|frag|vert)$/,
      exclude: /node_modules/,
      use: [
        {
          loader: 'glslify-loader',
          options: {
            transform: [
              ['glslify-hex', { 'option-1': true, 'option-2': 42 }]
            ]
          }
        }
      ],
      type: 'asset/source'
    }
  ]
}

Contributing

See stackgl/contributing for details.

License

MIT. See LICENSE.md for details.

3.0.3

8 months ago

3.0.2

8 months ago

3.0.1

11 months ago

3.0.0

1 year ago