/*************************************** * This Gruntfile is organized with two phases, * compile and build. Compile will lint HTML, * JavaScript and compile LESS. The build phase * creates an optimized stand-alone build that * can be distributed. */ module.exports = function(grunt) { var buildDir = 'build/'; var srcDir = 'src/'; grunt.initConfig({ clean: { build: { src: [buildDir] } }, coffee: { options: { bare: true }, compile: { files: [{ expand: true, cwd: srcDir, src: ['client/qed-client/**/*.coffee', 'server/**/*.coffee'], dest: buildDir, ext: '.js' }] } }, copy: { compile: { files: [{ src: [srcDir+'**', '!**/*.coffee' ], dest: buildDir }] } }, dojo: { options: { dojo: srcDir+'client/dojo/dojo.js' }, build: { options: { profile: srcDir+'client/client.profile.js', releaseDir: buildDir } } }, htmlhint: { options: { htmlhintrc: srcDir+".htmlhintrc" }, compile: { files: [{ expand: true, cwd: srcDir, src: ['client/*.html', 'client/qed-client/**/*.html'] }] } }, jshint: { options: { jshintrc: srcDir+".jshintrc" }, compile: { files: [{ expand: true, cwd: srcDir, src: ['client/qed-client/**/*.js', 'server/**.js'] }] } }, less: { options: { strictImports: false, dumpLineNumbers: "all" }, compile: { files: [{ expand: true, cwd: srcDir, src: ['client/qed-client/css/qed.less'], dest: buildDir, ext: '.css' }] } } }); grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-coffee'); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-less'); grunt.loadNpmTasks('grunt-curl'); grunt.loadNpmTasks('grunt-dojo'); grunt.loadNpmTasks('grunt-htmlhint'); grunt.loadNpmTasks('grunt-zip'); grunt.registerTask('compile', ['less:compile', 'jshint:compile', 'htmlhint:compile', 'coffee:compile', 'copy:compile']); grunt.registerTask('build', ['clean:build', 'compile', 'dojo:build']); grunt.registerTask('deploy', []); grunt.registerTask('default', ['compile']); };