Skip to content

Instantly share code, notes, and snippets.

@the-teacher
Forked from pomahtuk/Gruntfile.coffee
Created March 8, 2014 07:46
Show Gist options
  • Save the-teacher/9426900 to your computer and use it in GitHub Desktop.
Save the-teacher/9426900 to your computer and use it in GitHub Desktop.
module.exports = (grunt) ->
# Project configuration.
grunt.initConfig
coffee:
options:
sourceMap: false
app:
expand: true
cwd: 'public/js/coffee/'
src: ['*.coffee']
dest: 'public/js/'
ext: '.js'
directives:
options:
join: true
files:
'public/js/directives.js': ['public/js/coffee/directives/*.coffee']
services:
options:
join: true
files:
'public/js/services.js': ['public/js/coffee/services/*.coffee']
controllers:
options:
join: true
files:
'public/js/controllers.js': ['public/js/coffee/controllers/*.coffee']
watch:
scripts:
files: ['public/js/coffee/**/*.coffee']
tasks: ['coffee']
options:
livereload: 3333
templates:
files: '**/*.slim'
tasks: ['slim']
options:
livereload: 3333
styles:
files: '**/*.sass'
tasks: ['compass']
options:
livereload: 3333
slim:
dist:
files: [
expand: true
src: ['**/*.slim']
ext: '.html'
]
compass:
dist:
options:
sassDir: 'public/css/sass'
cssDir: 'public/css'
nodemon:
dev:
script: "app.coffee"
options:
ignoredFiles: ['public/**', 'views/**', 'partials/**', 'locales/**', 'Gruntfile.coffee', '.sass-cache/**', 'node_modules/**'],
ignore: ['public/**', 'views/**', 'partials/**', 'locales/**', 'Gruntfile.coffee', '.sass-cache/**', 'node_modules/**'],
file: "app.coffee"
ext: "js,coffee"
concurrent:
first:
tasks: ['coffee', 'compass', 'slim']
options:
logConcurrentOutput: true
second:
tasks: ['nodemon', 'watch']
options:
logConcurrentOutput: true
# These plugins provide necessary tasks.
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-slim'
grunt.loadNpmTasks 'grunt-contrib-compass'
grunt.loadNpmTasks 'grunt-nodemon'
grunt.loadNpmTasks 'grunt-concurrent'
# Default task.
grunt.registerTask 'default', [
'concurrent:first',
'concurrent:second'
]
grunt.registerTask 'build', ['coffee', 'compass', 'slim']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment