Skip to content

Instantly share code, notes, and snippets.

@StuartHarris
Last active December 28, 2015 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save StuartHarris/7503388 to your computer and use it in GitHub Desktop.
Save StuartHarris/7503388 to your computer and use it in GitHub Desktop.
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