Task helpers for Cakefiles
require 'frosting'task 'compile:dev''Compile development distro files'->each './lib/*.coffee' fcompile -> fwrite "./dist/dev/.js"task 'compile:min''Compile minified distro files'->each './lib/*.coffee' fcompile -> fminify -> fwrite "./dist/min/.js"task 'compile''Compile all distro files'->invoke 'compile:dev'invoke 'compile:min'
Frosting is definitely an opinionated set of build tools. It assumes that source files are being written in coffeescript and minification will be done via uglify-js.
Frosting provides a couple of convenience methods that yield a
This class has the necessary API for reading, writing, mutating, inspecting,
compiling and minifying source files.
each can be used to iterate over a set of source files. It accepts a callback
which will be passed a
File instance for each file, and you can build as you wish
from there. It can be given a glob pattern or an explicit array of files.
each './lib/*.coffee' # `f` is an instance of File# oreach'./lib/foo.coffee''./lib/bar.coffee''./lib/baz.coffee'# `f` is an instance of File
concat is similar to each, except it simply concatenates all of the source
files into one coffeescript file and yields a
File instance with the combined
sources already in the buffer. If given an array of filenames, they will be
read and concat'd in order.
concat './lib/*.coffee' # `f` is an instance of File, will only get called once# orconcat'./lib/foo.coffee''./lib/bar.coffee''./lib/baz.coffee'# `f` is an instance of File, will only get called once
TODO describe the