Boomer
Ok what
Boomer cuts down on your task configuration. It is essentially a wrapper for grunt-contrib-connect and grunt-contrib-watch. You can also use an express app on top of it, that gives you a little more flexibility.
Show me
Excerpt from the test case.
var boomer = module{ }
boomer
is a function, you should call it with a grunt instance
and an optional task name.
Note: by default boomer registers under the "default" grunt task.
Here's an express example (also from the tests):
var path = var boomer = var express = var app = module{ }
What is what
.connect(options)
options
- Object
Simple: it gets passed to the connect task as follows:
grunt
.express(app, setup)
app
- Function
Like this:
var app =
setup
- Function [Optional]
A function called when the task is run. Use it to setup your app here.
You should slate calling methods like .use()
on the app,
because boomer dynamically assigns a free port to the server when the task is run.
In order for the live reloading to work, your app initialization must come after the live reload script.
Use the setup callback to do that.
.watch(options)
options
- Object
Gets passed directly to the watch task like this:
for var name in options grunt
.lr(options)
options
- Object
Boomer registers a helper task called lr
.
It has a single boolean option called refresh
.
If set to true, only the first file will be posted to the lr server.
It's useful when you want to monitor files that would always reload the whole page (like .js, .html),
so only one will be sent.
It posts changed files to the livereload server so your browser can refresh.
It does this:
for var name in options grunt
.started(callback)
callback
- Function(options)
Called when the server is started.
options.host
The host the server is running on. (Usually your local IP)
options.port
The server port.
options.livereload
The livereload port.
Usage
Check the source, it's really straightforward.
Use it like this:
// I want these files posted to the browser
That's it! MIT. Happy coding!