techpines/asset-rack — pull request #112 by boblauer (2013-11-11 19:10:04+00:00)
Title: Updated browserify version

Updated to work with the latest version of Browserify. Maintains backwards compatibility with coffee script by automatically using the coffeeify transform if the file ends in .coffee.

Looks like Uglify was updated a few days ago, so if this gets pulled, #98 can be closed.

This pull request adds a bit more flexibility to BrowserifyAssets. You can specify `require`, `transform`, and `external`, all of which are arrays. Filename is also now optional, as you may have a bunch of files that don't have an entry point, such as bundling 3rd party libraries that are referenced from a different bundle.

As an example:

```javascript
// Bundled Libraries
new BrowserifyAsset({
url: '/libs.js',
require: [
{ file: './libs/jquery.min.js', options: { expose: 'jquery' } },
{ file: './libs/angular.js', options: { expose: 'angular' } },
{ file: './libs/lodash.js', options: { expose: 'lodash' } }
],
compress: true
});

// Bundled App Code
new BrowserifyAsset({
url: '/app.js',
filename: __dirname + '/client/app.js',
external: ['jquery', 'angular', 'lodash'],
transform: ['es6ify'],
compress: true
});
```