Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Gruntfile.js 'use strict'; ! module.exports = function (grunt) { ! // Load grunt tasks automatically require('load- grunt-tasks') (grunt); ! // Time how long tasks take. Can help when optimizing build times require('time- grunt')(grunt); ! // Define the configuration for all the tasks grunt.initConfi g({ ! // Project settings xd: { app: 'app', dist: 'dist' }, // Set bower task's targetDir to use app directory bower: { options: { targetDir: '<%= xd.app %>/lib' }, // Provide install target install: {} }, // Watches files for changes and runs tasks based on the changed files watch: { files: ['<%= xd.app %>/**/*', '*.js', '.jshintrc'], tasks: ['build'], livereload: { options: { livereload : '<%= connect.option s.livereload %>' }, files: ['<%= xd.app %>/**/*', '*.js', '.jshintrc'] } }, protractor: { options: { // configFile: "test/ protractor.conf. js", // Default config file keepAlive: true, // If false, the grunt process stops when the test fails. noColor: false, // If true, protractor will not use colors in its output. args: { specs: [ './test/ e2e/**/*.spec.js' ], baseUrl: 'http:// localhost:8000', chromeD river: 'node_modules /protractor/ selenium/ chromedriver' } }, run: { } }, // The actual grunt server settings connect: { options: { port: 8000, // Set to '0.0.0.0' to access the server from outside. hostname: '0.0.0.0', livereload: 35729 }, livereload: { options: { open: true, base: [ '.tmp', '<%= xd.app %>' ], middlewa re: function (connect, options) { ! if (! Array.isArray(o ptions.base)) { option s.base = [options.base]; } var middlewares = [require('grunt- connect-proxy/ lib/ utils').proxyRe quest]; ! options. base.forEach(f unction (base) { grunt.l og.warn(base); middle wares.push(co nnect.static(ba se)); }); return middlewares; } } }, test: { options: { port: 9001, base: [ '.tmp', 'test', '<%= xd.app %>' ] } }, dist: { options: { base: '< %= xd.dist %>' } }, proxies: [ { context: ['/batch', '/job', '/modules', '/ streams'], host: 'localhost', port: 9393, changeOr igin: true } ] }, ! // Make sure code styles are up to par and there are no obvious mistakes jshint: { options: { jshintrc: '.jshintrc', reporter: require('jshint- stylish') }, all: [ 'Gruntfile.j s', '<%= xd.app %>/ scripts/{,**/}*.js' ], test: { options: { jshintrc: 'test/.jshintrc' }, src: ['test/ spec/{,*/}*.js'] } }, less: { dist: { files: { '<%= xd.app %>/ styles/ main.css': ['< %= xd.app %>/ styles/ main.less'] }, options: { sourceMa p: true, sourceMa pFilename: '< %= xd.app %>/ styles/ main.css.map', sourceMa pBasepath: '< %= xd.app %>/', sourceMa pRootpath: '/' } } }, // Empties folders to start fresh clean: { dist: { files: [ { dot: true, src: [ '.tmp', '<%= xd.dist %>/*' ] } ] }, server: '.tmp' }, ! // Add vendor prefixed styles autoprefixer: { options: { browsers: ['last 1 version'] }, 12