0.2.2 • Published 7 years ago

pull-browserify v0.2.2

Weekly downloads
9
License
MIT
Repository
github
Last release
7 years ago

pull-browserify

Browserify functions for pull stream

This simply wraps browserify in pull-stream functions.

var pull = require('pull-stream')
var vinyl = require('pull-vinyl')
var b = require('pull-browserify')

pull(
  b.source('some-file.js'),
  b.add('another-file.js'),
  b.transform('babelify', { ...opts }),
  b.bundle(),
  vinyl.map('index.js'),
  vinyl.write('out')
)

Installation

$ npm install --save pull-browserify

Usage

browserify([files, opts])

browserify.source([files, opts])

Creates a browserify object in the pipeline, where you can use the functions (or pull.map) to manage it.

browserify.{add, require, external, ignore, exclude, transform}

These just wrap their browserify counterparts in pull.map. You can read the docs there.

var settings = pull(
  browserify.add('./some-shim.js')
  browserify.transform('babelify', { ...opts }),
  browserify.exclude('./other-file.js'),
  // ...
)

pull(
  browserify('./app/index.js'),
  settings,
  browserify.bundle(),
  // ...
)

browserify.bundle()

Maps the stream to the bundled source buffer. You can write it to the file system or do whatever.

pull(
  // ... after sourcing and adding settings
  browserify.bundle(),
  vinyl.map('index.js'),
  vinyl.write('out')
)

License

MIT © Jamen Marz


version travis downloads license support me follow

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.0

7 years ago