Skip to content

jamen/pull-bundle-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Bundle JS files inside pull-stream

Resources

License

Stars

Watchers

Forks

Packages

No packages published