1.0.0 • Published 7 years ago
pull-bundle v1.0.0
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:
pull-bundle-js
for bundling JS with Browserifypull-concat-files
for bundling CSS filespull-bundle-html
for wraping the JS/CSS into boilerplate HTML
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
pull-files
for reading and writing filespull-minify
for minifying the files
Maintained by Jamen Marz (See on Twitter and GitHub for questions & updates)