Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
88 lines (59 sloc) 2.67 KB

Brunch with Spine and Sass - The Hem way

A Spine based skeleton for Brunch following the Hem workflow.


The idea behind this skeleton is to provide a workflow for SpineJS, similar to the one provided when working with Hem by Alex MacCaw.

Thanks to Brunch, this Skeleton will build one JS file to be included in your HTML, wrapping jQuery, SpineJS modules and your CoffeeScript/JavaScript code into CommonJS modules in the correct order. This way you can use require() in your Coffee/JS/HTML files just like we used to do in Hem.

Additionally, it will compile your SASS file(s) into one compressed CSS file.

Languages used:

Getting Started:


Clone the repository and run:

  • npm install which will install the required plugins. You need to have Node installed first
  • brunch build which will build the following files:
    • public/css/style.css (compressed)
    • public/application.js wrapping all the Coffee/JS files saved recursively in the app/ directory into CommonJS modules
  • Brunch provides a brunch watch --server command as well wich will serve your app and rebuild everything whenever a file is saved.

Project Structure:

  -lib/ (if you need to include additional JS libraries) (your main application file)
  -application.js (generated)
   -style.css (generated)

Requiring files:

All modules are relative to the app/ directory. Examples:

# to require spine.js
Spine = require('lib/spine') # which is located in app/lib/spine.js

# if you have a file in the app/models and
# you need to require it somewhere else:
User = require('models/user') # which is located in app/models/

Make sure to add:

module.exports = [your_module_identifier]

before the end of every file. Check Spine's documentation for more about CommonJS.


  • Add testing support
  • Add other CSS preprocessors support
  • Add Handlebars Support (probabily will be the first update)


  • SpineJS 1.2.2
  • jQueryify 2.0.3 (jQuery npm module for the browser)
  • Reach out for help or questions