Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ '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.initConfig({ ! // 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.options.li vereload %>' }, 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', chromeDriv er: '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 %>' ], middleware : function (connect, options) { ! if (! Array.isArray(opti ons.base)) { options.b ase = [options.base]; } var middlewares = [require('grunt- connect-proxy/lib/ utils').proxyReque st]; ! options.ba se.forEach(functi on (base) { grunt.log .warn(base); middlew ares.push(connec t.static(base)); }); 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, changeOrig in: 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.js', '<%= 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: { sourceMap: true, sourceMap Filename: '<%= xd.app %>/styles/ main.css.map', sourceMap Basepath: '<%= xd.app %>/', sourceMap Rootpath: '/' } } }, // 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'] }, dist: { files: [ 10 Gruntfile.js