/*************************************** * 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. */ var fs = require('fs'); var path = require('path'); module.exports = function(grunt) { var buildDir = '../build/'; grunt.initConfig({ copy: { build: { files: [ {src: ['client/*.html'], dest: buildDir}, {src: ['server/**', '!**/node_modules/**'], dest: buildDir}, {src: ['qed-server.key', 'qed-server.pem'], dest: buildDir}, ] } }, dojo: { options: { dojo: 'client/dojo/dojo.js', }, build: { options: { profile: 'client/client.profile.js' } } }, htmlhint: { options: { htmlhintrc: ".htmlhintrc" }, compile: { files: { src: ['client/*.html', 'client/qed-client/**.html'] } } }, jshint: { options: { jshintrc: ".jshintrc" }, compile: { files: { src: ['client/qed-client/**/*.js', 'server/**.js', '!**/node_modules/**'] } } }, less: { options: { strictImports: false, dumpLineNumbers: "all" }, compile: { files: { 'client/qed-client/css/qed.css': 'client/qed-client/css/qed.less' } } } }); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-less'); grunt.loadNpmTasks('grunt-dojo'); grunt.loadNpmTasks('grunt-htmlhint'); grunt.registerTask('compile', ['less:compile', 'jshint:compile', 'htmlhint:compile']); grunt.registerTask('build', ['compile', 'dojo:build', 'copy:build']); grunt.registerTask('default', ['compile']); };