Package Exports
- buildr
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (buildr) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Welcome to Buildr. The JavaScript Package Buildr.
Installation
Install Buildr
npm -g install buildr
Optional. If you would also like to support image compression
On OSX
npm -g install pulverizr-bal ruby -e "$(curl -fsSLk https://gist.github.com/raw/323731/install_homebrew.rb)" brew install gifsicle libjpeg optipng pngcrush
On Apt Linux
npm -g install pulverizr-bal sudo apt-get update && sudo apt-get install gifsicle libjpeg-progs optipng pngcrush
On Yum Linux
npm -g install pulverizr-bal sudo yum -y install gifsicle libjpeg-progs optipng pngcrush
On Windows
You're out of luck
Usage
In the javascript program which you would like to buldr, run the following in terminal:
buildr .
Configuration
Buildr does not require any configuration by default, but if you would like to configure it you can create a package.json
file which can look something like this:
{
"name": "my-project",
"buildr": {
"compress": true,
"bundle": true,
"directories": {
"out": "./out",
"src": "./src"
},
"files": true
}
If you would like configure it even further, the following options are available under the buildr
key:
compress
: a boolean value or an object, if an object:js
: a boolean valuecss
: a boolean valueimg
: a boolean valuehtml
: a boolean value
check
: a boolean value or an object, if an object:js
: a boolean value; whether or not we should run javascript through the JSLint checker before buildingjsOptions
: an object; to pass to the JSLint checker
bundle
: a boolean value or an object, if an object:js
: a boolean value or a javascript filename; what should the bundled Javascript file be called?css
: a boolean value or a css filename; what should hte bundled CSS file be called?src
: a boolean value; whether or not we should bundle the source files too
directories
: an objectout
: a directory path; of where the compiled files will gosrc
: a directory path; of where source files come from
subpackages
: an array; containing the locations of each subpackage to compress and bundlefiles
: an objectjs
: a boolean value or array; of javascript files to compress and bundlecss
: a boolean value or array; of css files to compress and bundleimg
: a boolean value or array; of image files to compress and bundle
templates
: an objectout_bundle_header.js
: a file path; to the header for the out bundled fileout_bundle_footer.js
: a file path; to the footer for the out bundled fileout_bundle_item.js
: a file path; to the replace string for each out bundled fileout_bundle_subpackage.js
: a file path; to the replace string for each out bundled subpackagesrc_bundle_header.js
: a file path; to the header for the src bundled filesrc_bundle_footer.js
: a file path; to the footer for the src bundled filesrc_bundle_item.js
: a file path; to the replace string for each src bundled filesrc_bundle_subpackage.js
: a file path; to the replace string for each src bundled subpackage
For further reference you can refer to the History.js package.json file which utilises simple bundling and compression, and the Aloha Editor package.json file which utilises bundling for both the src and out packages, subpackages and javascript+css+image compression.
License
Licensed under the MIT License Copyright 2011 Benjamin Arthur Lupton
Todo
- Make it asynchronous
- Turn the CSS minifier into it's own project