https://github.com/bmatcuk/glslify-brunch
Run glsl files through glslify in brunch
https://github.com/bmatcuk/glslify-brunch
Last synced: over 1 year ago
JSON representation
Run glsl files through glslify in brunch
- Host: GitHub
- URL: https://github.com/bmatcuk/glslify-brunch
- Owner: bmatcuk
- License: mit
- Created: 2015-07-08T05:06:03.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T20:14:36.000Z (over 3 years ago)
- Last Synced: 2025-02-06T02:02:38.051Z (over 1 year ago)
- Language: JavaScript
- Size: 165 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-brunch - Glslify-brunch
README
# glslify-brunch
Run glsl files through [glslify](https://github.com/stackgl/glslify) in [brunch](http://brunch.io/).
## 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:
```coffee
exports.config =
...
plugins:
glslify:
transform: ...
```
Transform options are passed unmolested straight into glslify, so see the [glslify documentation](https://github.com/stackgl/glslify#source-transforms) 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:
```javascript
module.exports = "...glsl...";
```
* If `modules.wrapper = 'amd'`, the output will be:
```javascript
define([], function() {
return "...glsl...";
});
```
* Otherwise, the output will be:
```javascript
Glsl = "...glsl...";
```
Where `` of `/path/to/file.ext` would be `file`.
If you'd like to change this behavior, you can set the `wrapper` option:
```coffee
exports.config =
...
plugins:
glslify:
wrapper: function(path, data) { return "...whatever..."; }
```
Make sure to `JSON.stringify(data)`