Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Gruntfile for building and compressing components that use CoffeeScript, Jade, JSON (depends on npm modules: component-coffee, component-jade, component-json, component-minify, grunt-combine, grunt-component-build)
module.exports = (grunt) ->
configure_component = (builder) ->
builder.use require 'component-coffee'
builder.use require 'component-jade'
builder.use require('component-json')()
builder.use require 'component-minify'
grunt.initConfig
componentbuild:
app:
options:
name: 'app'
configure: configure_component
src: 'app/'
dest: 'build/'
combine:
# because component-coffee doesn't adjust the script extensions in the require-alias
app:
input: 'build/app.js'
output: 'build/app.js'
tokens: [
token: '.coffee'
string: '.js'
]
grunt.loadNpmTasks 'grunt-combine'
grunt.loadNpmTasks 'grunt-component-build'
grunt.registerTask 'default', ['componentbuild', 'combine']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.