Skip to content

Instantly share code, notes, and snippets.

@davidvanleeuwen
Last active December 14, 2015 18:28
Show Gist options
  • Save davidvanleeuwen/5129286 to your computer and use it in GitHub Desktop.
Save davidvanleeuwen/5129286 to your computer and use it in GitHub Desktop.
Create the tasks
grunt.initConfig
coffee:
scripts:
files:
grunt.file.expandMapping(['src/scripts/**/*.coffee'], 'blog/scripts/',
rename: (destBase, destPath) ->
return destBase + destPath.slice(12, destPath.length)
.replace(/\.coffee$/, '.js')
)
main:
files:
'blog/scripts/main.js': 'src/main.coffee'
sass:
options:
compass: true
style: 'compressed'
compile:
files:
'blog/stylesheets/main.css': 'src/stylesheets/main.sass'
haml:
templates:
compile:
options:
language: 'coffee'
namespace: 'JST'
target: 'js'
files:
grunt.file.expandMapping(['src/templates/**/*.haml'],
'blog/scripts/templates/',
rename: (destBase, destPath) ->
return destBase + destPath.slice(13, destPath.length)
.replace(/\.haml$/, '.js')
)
index:
compile:
options:
target: 'html'
files:
'blog/index.html': 'src/index.haml'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment