Giter Site home page Giter Site logo

grunt-browserify's Introduction

build status

grunt-browserify

Grunt task for node-browserify. Current version: 1.0.0.

Getting Started

This plugin requires Grunt ~0.4.0 and Node >=0.10.x.

Install this grunt plugin with:

npm install grunt-browserify --save-dev

Then add this line to your project's grunt.js Gruntfile:

grunt.loadNpmTasks('grunt-browserify');

Documentation

Run this task with the grunt browserify command. As with other Grunt plugins, the src and dest properties are most important: src will use the Grunt glob pattern to specify files for inclusion in the browserified package, and dest will specify the outfile for the compiled module.

Options

ignore

Type: [String]

Specifies files to be ignored in the browserify bundle.

alias

Type: [String:String] or comma-separated String

Browserify can alias files to a certain name. For example, require(‘./foo’) can be aliased to be used as require(‘foo’). Aliases should be specified as fileName:alias.

external

Type: [String]

Specifies files to be loaded from a previously loaded, “common” bundle.

externalize

Type: [String]

Specifies modules(s) to be exposed outside of a bundle, which is necessary for building "common" bundles which can be loaded via the external option above. Basically, it's a list of files which are supplied to browserify via its require or -r command.

transform

Type: [String || Function]

Specifies a pipeline of functions (or modules) through which the browserified bundle will be run. The browserify docs themselves explain transform well, but below is an example of transform used with grunt-browserify to automatically compile coffeescript files for use in a bundle:

browserify: {
  'build/module.js': ['client/scripts/**/*.js', 'client/scripts/**/*.coffee'],
  options: {
    transform: ['coffeeify']
  }
}

debug

Type: Boolean

Enable source map support.

shim

Type: Object

Provide a config object to be used with browserify-shim

###Usage To get things running, add the following entry to grunt.initConfig():

browserify: {
  'build/module.js': ['client/scripts/**/*.js']
}

More complicated use cases can be found within this projects own Gruntfile.

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.

Release History

v0.1.0

  • Initial release

v0.1.1

  • Properly support compact and full grunt task syntax

v0.2.0

  • Add support for Browserify 2

v0.2.4

  • Add externalize option, to expose modules to external bundles
  • Add browserify-shim support
  • Completely rewrote and significantly improved tests
  • Various fixes

v0.2.5

  • Update externalize to expose npm modules to external bundles

v1.0.0

  • Really should've been released at v0.2, but better late than never!

v1.0.2

  • Move away from browserify-stream to callback approach

License

Copyright (c) 2013 Justin Reidy Licensed under the MIT license.

grunt-browserify's People

Contributors

jmreidy avatar pix avatar wilsonpage avatar bclinkinbeard avatar jamesjwood avatar janm6k avatar alfredc avatar anthonyshort avatar aratramba avatar joaojeronimo avatar shama avatar robbles avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.