pull-bundle-js

0.6.0 • Public • Published

pull-bundle-js

Bundle JS files inside pull-stream with Browserify

Bundles the js pull-stream files using Browserify

var pull = require('pull-stream')
var { read, write } = require('pull-files')
var bundle = require('pull-bundle-js')

pull(
  read([ 'index.js', 'lib/**/*.js' ], { cwd: __dirname }),
  bundle('app.js', ['babelify', 'es2040']),
  write('out', err => {
    // finished
  })
)

Install

npm i pull-bundle-js

Usage

bundle(path?, options?)

Bundles commonjs files using Browserify to use commonjs modules and several Node.js built-ins on the browser

The options are passed to browserify(options), in addition to:

  • path: Path of the resulting bundle. Optional if the path will never be used (e.g. goes into HTML directly after)
  • strict: Only allow files with .js to pass through. Defaults to false

You can also pass options as an array as a shorthand for transforms: [ ...options ]

Also see

Package Sidebar

Install

npm i pull-bundle-js

Weekly Downloads

3

Version

0.6.0

License

MIT

Last publish

Collaborators

  • npm