Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated browserify version #112

Closed
wants to merge 5 commits into from

Conversation

boblauer
Copy link

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:

// 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
});

@bryanchriswhite
Copy link

I think this is great.
Included in #80 - please close

@boblauer boblauer closed this Jun 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants