Skip to content

bmatcuk/glslify-brunch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

Run glsl files through glslify in brunch

Resources

License

Stars

Watchers

Forks

Packages

No packages published