glslify-brunch

1.0.3 • Public • Published

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(pathdata) { return "...whatever..."; }

Make sure to JSON.stringify(data)

Package Sidebar

Install

npm i glslify-brunch

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

5.5 kB

Total Files

6

Last publish

Collaborators

  • bmatcuk