The (Java|Coffee)Script and (CSS|Less) (Builder|Bundler|Packer|Minifier|Merger|Checker)
-
Install CoffeeScript
npm -g install coffeescript
Before you use Buildr, you must specify some configuration for it. Here is an example:
{
srcPath: 'src'
outPath: 'out'
outStylePath: 'out/styles.css'
outScriptPath: 'out/scripts.js'
scripts: [
'scripts/file1.js'
'scripts/file2.coffee'
]
styles: [
'styles/file1.css'
'styles/file2.less'
]
compress: true
}
Which works great for the following app structure:
- app - src - scripts - file1.js - file2.coffee - styles - file1.css - file2.less
Using that configuration with buildr will copy app/src
to app/out
and generate out/styles.css
from the styles and generate out/scripts.js
from the scripts - both of which would be compressed.
If you'd prefer to have the srcPath
and the outPath
the same, you can do that too.
-
Installation
-
Install Buildr Globally
npm -g install buildr
-
If you also want image compression, do this:
-
On OSX
ruby -e "$(curl -fsSLk https://gist.github.com/raw/323731/install_homebrew.rb)" brew install gifsicle libjpeg optipng pngcrush
-
On Apt Linux
sudo apt-get update && sudo apt-get install gifsicle libjpeg-progs optipng pngcrush
-
On Yum Linux
sudo yum -y install gifsicle libjpeg-progs optipng pngcrush
-
-
-
Stick your configuration in
app/buildr.cson
-
Within your app root, run
buildr
-
Install Buildr Locally
npm install buildr
-
Code
buildr = require 'buildr' config = {} # your configuration myBuildr = buildr.createInstance(config) myBuildr.process (err) -> throw err if err
Licensed under the MIT License Copyright 2011 Benjamin Arthur Lupton
To install a specify version, say version 0.2, run npm install buildr@0.2
-
v0.4 July 1, 2011
- Extremely Simplified
- Needs javascript compression re-added
- Needs image compression re-added
- Needs auto file finding
- Needs jshint checking on
.js
files (not.coffee
files) - Needs no-config version
- Needs unit tests for the first time
-
v0.3 May 31, 2011
- Exploration into better architectures
-
v0.2 April 2, 2011
- Initial Release
-
v0.1 March 23, 2011
- Initial Commit