node package manager


roots extension enabling the use of browserify

Roots Browserify

Roots browserify is an alternate javascript pipeline that uses commonjs and browserify to build and concatenate scripts.

Note: This project is in early development, and versioning is a little different. Read this for more details.

  • make sure you are in your roots project directory

  • npm install roots-browserify --save

  • modify your file to include the extension, as such

    browserify = require('roots-browserify')
    module.exports =
      extensions: [browserify(files: "assets/js/"out: 'js/build.js')]

This extension very directly uses browserify's javascript API under the hood. For basic usage, pass either a string with a file path or an array of file path strings as entry points for browserify, and an output path where all the concatenated scripts should be written, as shown in the example above.

String or array of strings pointing to one or more file paths which will serve as the base. See browserify docs for more info.

Generates an inline sourcemap, external if minify is true. Default is false.

Minfifies the output. Default is false.

Any additional options you'd like to be passed in to browserify. Again, documented here. Default is { extensions: ['.js', '.json', '.coffee'] }.

Where you want to output your built js file to in your public folder (or whatever you have set output to in the roots settings). There is no default. Recommended is js/build.js

If you'd like to add additional custom transforms, you can do it through this option. Pass either a transform function or an array of functions and they will be included in the pipeline. Default is coffeeify (add that string to your array if you want to keep coffeeify as well, otherwise it will be overridden).