DrMartiner
11/18/2013 - 8:48 AM

gruntfile.coffee

gruntfile.coffee

module.exports = (grunt) ->
    grunt.initConfig
        pkg: grunt.file.readJSON 'package.json'
        watch:
            coffee:
                files: ['static/coffee/**/*.coffee']
                tasks: ['coffee:dist']
            less:
                files: ['static/css/**/*.less']
                tasks: ['less:dist']
        coffee:
            dist:
                files: [{
                    expand: true,
                    cwd: 'static/coffee',
                    src: '**/*.coffee',
                    dest: 'static/js',
                    ext: '.js'
                }]
        less:
            dist:
                options:
                    paths: ["static/css/less"]
                files:
                    "static/css/style.css": "static/css/less/style.less"

    grunt.loadNpmTasks 'grunt-contrib-coffee'
    grunt.loadNpmTasks 'grunt-contrib-watch'
    grunt.loadNpmTasks 'grunt-contrib-less'

    grunt.registerTask 'run', [
        'coffee:dist',
        'less:dist',
        'watch'
    ]