Skip to content

Instantly share code, notes, and snippets.

@eagsalazar
Created June 24, 2013 00:16
Show Gist options
  • Save eagsalazar/5847040 to your computer and use it in GitHub Desktop.
Save eagsalazar/5847040 to your computer and use it in GitHub Desktop.
Grunt file for building www for phonegap/cordova
module.exports = (grunt) ->
grunt.loadNpmTasks('grunt-contrib-coffee')
grunt.loadNpmTasks('grunt-contrib-jade')
grunt.loadNpmTasks('grunt-contrib-sass')
grunt.loadNpmTasks('grunt-contrib-watch')
grunt.loadNpmTasks('grunt-contrib-connect')
grunt.loadNpmTasks('grunt-contrib-clean')
grunt.loadNpmTasks('grunt-contrib-copy')
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
copy:
main:
files: [
{expand: true, src: ['vendor/**'], dest: 'build/'},
{expand: true, cwd: 'static/', src: ['**'], dest: 'build/'}
]
jade:
compile:
options:
pretty: true
files:
"build/index.html": ["app/assets/templates/index.jade"]
coffee:
compile:
options:
sourceMap: true
expand: true
cwd: "app/assets/javascripts/"
src: "**/*.coffee"
dest: "build/js/"
ext: '.js'
sass:
dist:
options:
lineNumbers: true
trace: true
files:
"build/css/app.css": ["app/assets/stylesheets/app.sass"]
clean: ["build/*"]
watch:
app:
files: ["app/**", "vendor/**", "static/**"]
tasks: ['build']
options:
livereload: true
connect:
server:
options:
base: 'build'
port: 6888
grunt.registerTask('build', ['clean', 'coffee', 'sass', 'jade', 'copy'])
grunt.registerTask('default', ['build', 'connect', 'watch'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment