Skip to content
Lance Pollard edited this page Apr 16, 2012 · 2 revisions

Pipeline

Tower has a built-in asset compilation and deployment pipeline. The config/assets.coffee manifest defines how assets are bundled.

  • Asset Manifest
  • Watchfile

Tasks

cake assets:bundle
cake assets:upload # cake assets:upload:s3
cake assets:stats

assets:bundle

Bundles all the assets

Asset Manifest

module.exports =
  javascripts:
    application: [
      "/app/models/user"
      "/app/models/post"
    ]
    bottom: [
      "/vendor/assets/javascripts/jmd/showdown"
      "/vendor/assets/javascripts/jmd/jquery.markedit"
    ]
    vendor: [
      "/vendor/assets/javascripts/tower"
      "/vendor/assets/javascripts/underscore"
    ]
    development: [
      "/vendor/assets/javascripts/jasmine"
      "/vendor/assets/javascripts/faker"
      "/vendor/assets/javascripts/coffeekup"
    ]
  
  stylesheets:
    base: [
      "/app/assets/stylesheets/reset"
      "/app/assets/stylesheets/typography"
    ]
    application: [
      "/app/assets/stylesheets/application"
    ]
    
try
  Tower.assetManifest = JSON.parse(require("fs").readFileSync("public/assets/manifest.json", "utf-8"))
catch error
  Tower.assetManifest = {}

Tasks

cake assets:bundle
cake assets:upload

Notes

Node 0.6.0 has a stable zlib in its core now: http://nodejs.org/docs/v0.6.7/api/zlib.html#zlib. The alternative was to use gzippo.

Tower.js

Everything here will be reflected on http://towerjs.org/guides.

Clone this wiki locally