browserify-brunch
Browserify + Brunch
Last updated 5 years ago by mikewhy .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install browserify-brunch 
SYNC missed versions from official npm registry.

browserify-brunch

Brunch + Browserify

If this seems a little weird, that's because it is. Brunch already wraps modules in CommonJS / AMD / whatever you like. But being able to use NPM modules in the browser is pretty great too.

Configuration

Example brunch-config.coffee

exports.config =
  # Note that the usual app.js is commented out.
  # This isn't needed when using Browserify.
  files:
    javascripts:
      joinTo:
        #'javascripts/app.js': /^app/
        'javascripts/vendor.js': /^(vendor|bower_components)/
        'test/javascripts/test.js': /^test\/(?!vendor)/
        'test/javascripts/test-vendor.js': /^test\/(?=vendor)/

  # Again, browserify provides these.
  modules:
    wrapper: false
    definition: false

  plugins:
    browserify:
      # A string of extensions that will be used in Brunch and for browserify.
      # Default: js json coffee ts jsx hbs jade.
      extensions: """
      js coffee
      """

      bundles:
        'javascripts/app.js':
          # Passed to browserify.
          entry: 'app/bootstrap.coffee'

          # Anymatch, as used in Brunch.
          matcher: /^app/

          # Direct access to the browserify bundler to do anything you need.
          onBrowserifyLoad: (bundler) -> console.log 'onWatchifyLoad'

          # Any files watched by browserify won't be in brunch's regular
          # pipeline. If you do anything before your javascripts are compiled,
          # now's the time.
          onBeforeBundle: (bundler) -> console.log 'onBeforeBundle'

          # Any files watched by browserify won't be in brunch's regular
          # pipeline. If you do anything after your javascripts are compiled,
          # now's the time.
          onAfterBundle: (error, bundleContents) -> console.log 'onAfterBundle'

          # Any options to pass to `browserify`.
          # `debug` will be set to `!production` if not already defined.
          # `extensions` will be set to a proper list of
          # `plugins.browserify.extensions`
          instanceOptions: {}

Current Tags

  • 1.7.3                                ...           latest (5 years ago)

8 Versions

  • 1.7.3                                ...           5 years ago
  • 1.7.2                                ...           5 years ago
  • 1.7.1                                ...           6 years ago
  • 1.7.0                                ...           6 years ago
  • 0.0.4                                ...           6 years ago
  • 0.0.3                                ...           6 years ago
  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 2
Dependencies (5)
Dev Dependencies (1)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |