Transforms are handled much like browserify. You can pass a `transform` option to the second argument, which takes an array of transforms. You can pass string values and they'll be resolved automatically. The transform streams themselves are functions which take a `filename` argument and return a through stream that transforms the input. Additionally, the `cwd` option has been added, which determines where to resolve transform streams from. It defaults to the target shader's directory. glslify.resolve has been exposed to make it possible to mimic glslify's file resolution, but it's probably worth pulling out into its own module in the future.
The first change is to optionally enable piping text into glslify-stream instead of reading the file directly. A second boolean argument is added to the function such that: require('glslify-stream')(path, true) Will not read the file and return a through stream for writing to. The second it to add pragmas to specify module start/end points. node_modules begin with: #pragma glslify_file start module And other external files: #pragma glslify_file start Both end with: #pragma glslify_file end These two changes make it possible to add browserify-style transform streams to glslify, in that they can be piped in a chain and ignore module code.