1.0.3 • Published 4 years ago

glslify-brunch v1.0.3

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

glslify-brunch

Run glsl files through glslify in brunch.

Installation

Install the plugin via npm with npm install --save glslify-brunch

Or manually:

  • Add "glslify-brunch": "x.y.z" to package.json and run npm install
  • If you want to use the git version, add: "glslify-brunch": "git+ssh://git@github.com:bmatcuk/glslify-brunch.git"

Configuration

In your brunch-config.coffee, you can add glslify transform options:

exports.config =
  ...
  plugins:
    glslify:
      transform: ...

Transform options are passed unmolested straight into glslify, so see the glslify documentation for the format of the options.

You can also configure how glslify-brunch converts your GLSL into javascript. The default depends on your modules.wrapper setting in your brunch-config.coffee file:

  • If modules.wrapper = 'commonjs' (the default brunch setting), the output will be:

    module.exports = "...glsl...";
  • If modules.wrapper = 'amd', the output will be:

    define([], function() {
      return "...glsl...";
    });
  • Otherwise, the output will be:

    <base filename>Glsl = "...glsl...";

    Where <base filename> of /path/to/file.ext would be file.

If you'd like to change this behavior, you can set the wrapper option:

exports.config =
  ...
  plugins:
    glslify:
      wrapper: function(path, data) { return "...whatever..."; }

Make sure to JSON.stringify(data)

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

5 years ago

1.0.0

9 years ago