Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including glslify-bundle with all npm packages installed. Try it out:

var glslifyBundle = require("glslify-bundle")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

glslify-bundle v5.1.1

Bundle a glslify-deps dependency tree into a GLSL source string

glslify-bundle

experimental

Bundle a glslify-deps dependency tree into a GLSL source string.

This has been separated from glslify-deps such that you can prebundle a dependency tree server-side, but then still modify shader file contents in a browser.

Usage

NPM

source = bundle(deps)

Takes the output object from glslify-deps and returns a bundled GLSL string.

var bundle = require('glslify-bundle')
var deps   = require('glslify-deps')
var path   = require('path')

var file = path.join(__dirname, 'index.glsl')

deps().add(file, function(err, tree) {
  if (err) throw err

  var glsl = bundle(tree)

  console.log(glsl)
})

Contributing

See stackgl/contributing for details.

License

MIT. See LICENSE.md for details.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free