11// Generated on <%= (new Date).toISOString().split('T')[0] %> using <%= rootGeneratorName() %> <%= rootGeneratorVersion() %>
22'use strict' ;
33
4- module . exports = function ( grunt ) {
4+ module . exports = function ( grunt ) {
55 var localConfig ;
66 try {
77 localConfig = require ( './server/config/local.env' ) ;
@@ -26,7 +26,6 @@ module.exports = function (grunt) {
2626
2727 // Define the configuration for all the tasks
2828 grunt . initConfig ( {
29-
3029 // Project settings
3130 pkg : grunt . file . readJSON ( 'package.json' ) ,
3231 yeoman : {
@@ -87,31 +86,31 @@ module.exports = function (grunt) {
8786 jsTest: {
8887 files : [ '<%%= yeoman.client %>/{app,components}/**/*.{spec,mock}.<%= scriptExt %>' ] ,
8988 tasks : [ < % if ( filters . babel ) { % > 'newer:jshint:all' < % } if(filters.ts) { % > 'newer:tslint:all' , 'newer:ts:client_test' , < % } %> , 'wiredep :test ', 'karma ']
90- } , < % if ( filters . stylus ) { % >
89+ } , < % if ( filters . stylus ) { % >
9190 injectStylus: {
9291 files : [ '<%%= yeoman.client %>/{app,components}/**/*.styl' ] ,
9392 tasks : [ 'injector:stylus' ]
9493 } ,
9594 stylus: {
9695 files : [ '<%%= yeoman.client %>/{app,components}/**/*.styl' ] ,
9796 tasks : [ 'stylus' , 'postcss' ]
98- } ,< % } if ( filters . sass ) { % >
97+ } ,< % } if ( filters . sass ) { % >
9998 injectSass: {
10099 files : [ '<%%= yeoman.client %>/{app,components}/**/*.{scss,sass}' ] ,
101100 tasks : [ 'injector:sass' ]
102101 } ,
103102 sass: {
104103 files : [ '<%%= yeoman.client %>/{app,components}/**/*.{scss,sass}' ] ,
105104 tasks : [ 'sass' , 'postcss' ]
106- } ,< % } if ( filters . less ) { % >
105+ } ,< % } if ( filters . less ) { % >
107106 injectLess: {
108107 files : [ '<%%= yeoman.client %>/{app,components}/**/*.less' ] ,
109108 tasks : [ 'injector:less' ]
110109 } ,
111110 less: {
112111 files : [ '<%%= yeoman.client %>/{app,components}/**/*.less' ] ,
113112 tasks : [ 'less' , 'postcss' ]
114- } ,< % } if ( filters . jade ) { % >
113+ } ,< % } if ( filters . jade ) { % >
115114 jade: {
116115 files : [ '<%%= yeoman.client %>/{app,components}/**/*.jade' ] ,
117116 tasks : [ 'jade' ]
@@ -240,14 +239,14 @@ module.exports = function (grunt) {
240239 env : {
241240 PORT : process . env . PORT || 9000
242241 } ,
243- callback : function ( nodemon ) {
244- nodemon . on ( 'log' , function ( event ) {
242+ callback : function ( nodemon ) {
243+ nodemon . on ( 'log' , function ( event ) {
245244 console . log ( event . colour ) ;
246245 } ) ;
247246
248247 // opens browser on initial server start
249- nodemon . on ( 'config:update' , function ( ) {
250- setTimeout ( function ( ) {
248+ nodemon . on ( 'config:update' , function ( ) {
249+ setTimeout ( function ( ) {
251250 require ( 'open' ) ( 'http://localhost:8080/debug?port=5858' ) ;
252251 } , 500 ) ;
253252 } ) ;
@@ -469,9 +468,9 @@ module.exports = function (grunt) {
469468
470469 // Run some tasks in parallel to speed up the build process
471470 concurrent: {
472- pre : [ < % if ( filters . stylus ) { % >
473- 'injector:stylus' , < % } if (filters.less) { % >
474- 'injector:less' , < % } if (filters.sass) { % >
471+ pre : [ < % if ( filters . stylus ) { % >
472+ 'injector:stylus' , < % } if(filters.less) { % >
473+ 'injector:less' , < % } if(filters.sass) { % >
475474 'injector:sass' , < % } %>
476475 'ngconstant '< % if ( filters . ts ) { % > ,
477476 'copy:constant'< % } % >
@@ -596,7 +595,7 @@ module.exports = function (grunt) {
596595 NODE_ENV : 'production'
597596 } ,
598597 all : localConfig
599- } ,< % if ( filters . jade ) { % >
598+ } ,< % if ( filters . jade ) { % >
600599
601600 // Compiles Jade to html
602601 jade: {
@@ -688,7 +687,7 @@ module.exports = function (grunt) {
688687 '.tmp/app/app.css' : '<%%= yeoman.client %>/app/app.styl'
689688 }
690689 }
691- } ,< % } if ( filters . sass ) { % >
690+ } ,< % } if ( filters . sass ) { % >
692691
693692 // Compiles Sass to CSS
694693 sass: {
@@ -700,7 +699,7 @@ module.exports = function (grunt) {
700699 '.tmp/app/app.css' : '<%%= yeoman.client %>/app/app.scss'
701700 }
702701 }
703- } ,< % } if ( filters . less ) { % >
702+ } ,< % } if ( filters . less ) { % >
704703
705704 // Compiles Less to CSS
706705 less: {
@@ -742,7 +741,7 @@ module.exports = function (grunt) {
742741 ]
743742 ]
744743 }
745- } , < % if ( filters . stylus ) { % >
744+ } , < % if ( filters . stylus ) { % >
746745
747746 // Inject component styl into app.styl
748747 stylus: {
@@ -762,7 +761,7 @@ module.exports = function (grunt) {
762761 '!<%%= yeoman.client %>/app/app.styl'
763762 ]
764763 }
765- } ,< % } if ( filters . sass ) { % >
764+ } ,< % } if ( filters . sass ) { % >
766765
767766 // Inject component scss into app.scss
768767 sass: {
@@ -782,7 +781,7 @@ module.exports = function (grunt) {
782781 '!<%%= yeoman.client %>/app/app.{scss,sass}'
783782 ]
784783 }
785- } ,< % } if ( filters . less ) { % >
784+ } ,< % } if ( filters . less ) { % >
786785
787786 // Inject component less into app.less
788787 less: {
@@ -826,12 +825,12 @@ module.exports = function (grunt) {
826825 } ) ;
827826
828827 // Used for delaying livereload until after server has restarted
829- grunt . registerTask ( 'wait ', function ( ) {
828+ grunt . registerTask ( 'wait ', function ( ) {
830829 grunt . log . ok ( 'Waiting for server reload...' ) ;
831830
832831 var done = this . async ( ) ;
833832
834- setTimeout ( function ( ) {
833+ setTimeout ( function ( ) {
835834 grunt . log . writeln ( 'Done waiting!' ) ;
836835 done ( ) ;
837836 } , 1500 ) ;
@@ -841,12 +840,12 @@ module.exports = function (grunt) {
841840 this . async ( ) ;
842841 } );
843842
844- grunt.registerTask('serve', function (target) {
845- if ( target === 'dist' ) {
843+ grunt.registerTask('serve', function(target) {
844+ if ( target === 'dist' ) {
846845 return grunt . task . run ( [ 'build' , 'env:all' , 'env:prod' , 'express:prod' , 'wait' , 'open' , 'express-keepalive' ] ) ;
847846 }
848847
849- if (target === 'debug') {
848+ if(target === 'debug') {
850849 return grunt . task . run ( [
851850 'clean:server' ,
852851 'env:all' ,
@@ -876,22 +875,20 @@ module.exports = function (grunt) {
876875 ]);
877876 } ) ;
878877
879- grunt . registerTask ( 'server' , function ( ) {
878+ grunt . registerTask ( 'server' , function ( ) {
880879 grunt . log . warn ( 'The `server` task has been deprecated. Use `grunt serve` to start a server.' ) ;
881880 grunt . task . run ( [ 'serve' ] ) ;
882881 } ) ;
883882
884883 grunt . registerTask ( 'test' , function ( target , option ) {
885- if ( target === 'server' ) {
884+ if ( target === 'server' ) {
886885 return grunt . task . run ( [
887886 'env:all' ,
888887 'env:test' ,
889888 'mochaTest:unit' ,
890889 'mochaTest:integration'
891890 ] ) ;
892- }
893-
894- else if ( target === 'client' ) {
891+ } else if ( target === 'client' ) {
895892 return grunt . task . run ( [
896893 'clean:server' ,
897894 'env:all' ,
@@ -905,21 +902,16 @@ module.exports = function (grunt) {
905902 'wiredep:test',
906903 'karma'
907904 ]);
908- }
909-
910- else if ( target === 'e2e' ) {
911-
912- if ( option === 'prod' ) {
905+ } else if ( target === 'e2e' ) {
906+ if ( option === 'prod' ) {
913907 return grunt . task . run ( [
914908 'build' ,
915909 'env:all' ,
916910 'env:prod' ,
917911 'express:prod' ,
918912 'protractor'
919913 ] ) ;
920- }
921-
922- else {
914+ } else {
923915 return grunt . task . run ( [
924916 'clean:server' ,
925917 'env:all' ,
@@ -937,47 +929,37 @@ module.exports = function (grunt) {
937929 'protractor'
938930 ]);
939931 }
940- }
941-
942- else if ( target === 'coverage' ) {
943-
944- if ( option === 'unit' ) {
932+ } else if ( target === 'coverage' ) {
933+ if ( option === 'unit' ) {
945934 return grunt . task . run ( [
946935 'env:all' ,
947936 'env:test' ,
948937 'mocha_istanbul:unit'
949938 ] ) ;
950- }
951-
952- else if ( option === 'integration' ) {
939+ } else if ( option === 'integration' ) {
953940 return grunt . task . run ( [
954941 'env:all' ,
955942 'env:test' ,
956943 'mocha_istanbul:integration'
957944 ] ) ;
958- }
959-
960- else if ( option === 'check' ) {
945+ } else if ( option === 'check' ) {
961946 return grunt . task . run ( [
962947 'istanbul_check_coverage'
963948 ] ) ;
964- }
965-
966- else {
949+ } else {
967950 return grunt . task . run ( [
968951 'env:all' ,
969952 'env:test' ,
970953 'mocha_istanbul' ,
971954 'istanbul_check_coverage'
972955 ] ) ;
973956 }
974-
957+ } else {
958+ grunt . task . run ( [
959+ 'test:server' ,
960+ 'test:client'
961+ ] ) ;
975962 }
976-
977- else grunt . task . run ( [
978- 'test:server' ,
979- 'test:client'
980- ] ) ;
981963 } ) ;
982964
983965 grunt . registerTask ( 'build' , [
0 commit comments