pull-bundle

1.0.0 • Public • Published

pull-bundle

Bundle an app with pull-stream

Stream in JS and/or CSS files, and produce boilerplate HTML file with some settings

pull(
  read('src/**/*.{js,css}'),
  bundle('app.html', {
    // Browserify options or transforms
    js: [ 'es2040', 'hyperxify' ],
    // Boilerplate HTML options
    html: {
      title: 'test app',
      body: '<div class='app'></div>',
      // ...
    }
  }),
  write('out/', err => {
    // done
  })
)

It wraps:

Install

npm install --save pull-bundle
yarn add pull-bundle

Usage

bundle(path?, options?)

Bundles JS and CSS files streamed in, using Browserify and concat

They take options as { js, html, css }. You can opt-out of each using lang: false.

The path shorthand corropsonds to options.html.path. If you opt-out of HTML, you can't use the shorthand.

pull(
  read(__dirname + '/src/**/*.{js,css}'),
  bundle({
    js: { ...browserify_options },
    html: { ...bundle_html_options },
    css: { path? }
  }),
  write(__dirname + '/out', err => {
    // done
  })
)

Also see


Maintained by Jamen Marz (See on Twitter and GitHub for questions & updates)

Dependencies (5)

Dev Dependencies (2)

Package Sidebar

Install

npm i pull-bundle

Weekly Downloads

1

Version

1.0.0

License

none

Last publish

Collaborators

  • npm