Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
480 additions
and
270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,62 @@ | ||
Welcome to Buildr. The JavaScript Package Buildr. | ||
# Welcome to Buildr. The JavaScript Package Buildr. | ||
|
||
Install it like so: | ||
|
||
## Installation | ||
|
||
npm install buildr | ||
|
||
Use it like so: | ||
__Note: if you would like to be able to compress image files, you will also need to follow the installation instructions [here](https://github.com/bentruyman/pulverizr/blob/master/pulverizr.js)__ | ||
|
||
|
||
## Usage | ||
|
||
buildr . | ||
|
||
Optionally you can specify a `package.json` file that contains: | ||
|
||
- `js: ['file1.js','file2.js']` - a list of javascript files to bundle and minify | ||
- `css: ['file1.css','file2.css']` - a list of css files to bundle and minify | ||
## 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 contains the following keys a `buildr` key: | ||
|
||
- `compress`: a boolean value or an object, if an object: | ||
- `js`: a boolean value | ||
- `css`: a boolean value | ||
- `img`: a boolean value | ||
- `html`: a boolean value | ||
|
||
- `bundle`: a boolean value or an object, if an object: | ||
- `js`: a boolean value or a javascript filename | ||
- `css`: a boolean value or a css filename | ||
- `src`: a boolean value; for whether or not we should bundle the source files too | ||
|
||
- `directories`: an object | ||
- `out`: a directory path; of where the compiled files will go | ||
- `src`: a directory path; of where source files come from | ||
|
||
- `subpackages`: an array; containing the locations of each subpackage to compress and bundle | ||
|
||
- `files`: an object | ||
- `js`: an array; of javascript files to compress and bundle | ||
- `css`: an array; of css files to compress and bundle | ||
|
||
- `templates`: an object | ||
- `out-bundle-header.js`: a file path; to the header for the out bundled file | ||
- `out-bundle-footer.js`: a file path; to the footer for the out bundled file | ||
- `src-bundle-item.js`: a file path; to the replace string for each out bundled file | ||
- `src-bundle-header.js`: a file path; to the header for the src bundled file | ||
- `src-bundle-footer.js`: a file path; to the footer for the src bundled file | ||
- `src-bundle-item.js`: a file path; to the replace string for each src bundled file | ||
|
||
|
||
## License | ||
|
||
Licensed under the [MIT License](http://creativecommons.org/licenses/MIT/) | ||
Copyright 2011 [Benjamin Arthur Lupton](http://balupton.com) | ||
|
||
|
||
Todo: | ||
## Todo | ||
|
||
1. Document properly | ||
2. Make it asynchronous | ||
3. Turn the CSS minifier into it's own project | ||
1. Make it asynchronous | ||
2. Turn the CSS minifier into it's own project | ||
3. Add image optimisation | ||
4. Support the sweet package json file above | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// Prepare | ||
var | ||
Buildr = require('buildr').Buildr, | ||
myBuildr = new Buildr(process.argv[2]||__dirname); | ||
myBuildr = new Buildr(process.argv[2]||'.'); | ||
|
||
// Run | ||
myBuildr.run(); |
Oops, something went wrong.