Skip to content

Latest commit

 

History

History
80 lines (56 loc) · 1.37 KB

README.md

File metadata and controls

80 lines (56 loc) · 1.37 KB

Grunt compile bootstrap

This is a basic Grunt setup for

  • Sass
  • Coffeescript
    • concatinated
    • sourcemaps
  • Javascript
    • minified
    • sourcemaps
  • Watch tasks

Directory setup

It assumes the following directory setup:

assets/
  js/
    *.js
  coffee/
    **/*.coffee
  img/
  fonts/
  css/
    *.sass
    *.css

Installation

Of course you need node.js. You start by installing the necessary node packages (defined in package.json).

$ npm install

Make sure you add the node_modules directory in your .gitignore. This will install the following packages:

  • grunt-contrib-coffee
  • grunt-contrib-compass
  • grunt-contrib-watch
  • grunt-jsmin-sourcemap
  • grunt-contrib-jshint

Commands

Start the default task:

$ grunt

Start the watch task for the coffeescripts:

$ grunt watch:app

Start the watch task for the sass files:

$ grunt watch:sass

Resulting files

It produces the following files:

assets/
	js/
		main.js
		main.js.map
		main.map
		main.min.js

You can include the main.min.js in production or main.js for development purposes.

Sourcemaps

The source maps allow you to debug the original javascript / Coffeescript files in your browser (use Chrome! if you don't already).

See for more information.