@tyduptyler13/glslify-loader

3.0.3 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i @tyduptyler13/glslify-loader

Weekly Downloads

317

Version

3.0.3

License

MIT

Unpacked Size

6.07 kB

Total Files

4

Last publish

Collaborators

  • tyduptyler13