Last active
December 28, 2015 12:49
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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