diff options
Diffstat (limited to 'Gruntfile.js')
-rw-r--r-- | Gruntfile.js | 61 |
1 files changed, 19 insertions, 42 deletions
diff --git a/Gruntfile.js b/Gruntfile.js index df7958c4f..028a7773d 100644 --- a/Gruntfile.js +++ b/Gruntfile.js | |||
@@ -33,6 +33,12 @@ module.exports = function (grunt) { | |||
33 | } | 33 | } |
34 | } | 34 | } |
35 | }, | 35 | }, |
36 | concurrent: { | ||
37 | options: { | ||
38 | logConcurrentOutput: true | ||
39 | }, | ||
40 | dev: [ 'watch:livereload', 'watch:sass', 'express:dev' ] | ||
41 | }, | ||
36 | copy: { | 42 | copy: { |
37 | dev: { | 43 | dev: { |
38 | cwd: 'node_modules/bootstrap-sass/assets/', | 44 | cwd: 'node_modules/bootstrap-sass/assets/', |
@@ -59,7 +65,7 @@ module.exports = function (grunt) { | |||
59 | port: 9000, | 65 | port: 9000, |
60 | node_env: 'development', | 66 | node_env: 'development', |
61 | debug: true, | 67 | debug: true, |
62 | background: true | 68 | background: false |
63 | } | 69 | } |
64 | } | 70 | } |
65 | }, | 71 | }, |
@@ -71,57 +77,28 @@ module.exports = function (grunt) { | |||
71 | } | 77 | } |
72 | }, | 78 | }, |
73 | watch: { | 79 | watch: { |
74 | express: { | 80 | livereload: { |
75 | files: [ paths.main, paths.routes, paths.src ], | ||
76 | tasks: [ 'express:dev' ], | ||
77 | options: { | ||
78 | livereload: true, | ||
79 | spawn: false | ||
80 | } | ||
81 | }, | ||
82 | dev: { | ||
83 | files: [ paths.jade, paths.css, paths.browserified ], | 81 | files: [ paths.jade, paths.css, paths.browserified ], |
82 | tasks: [ ], | ||
84 | options: { | 83 | options: { |
85 | livereload: true, | 84 | livereload: true |
86 | nospawn: false | ||
87 | } | 85 | } |
86 | }, | ||
87 | sass: { | ||
88 | files: [ paths.scss ], | ||
89 | tasks: [ 'sass:dev' ] | ||
88 | } | 90 | } |
89 | } | 91 | } |
90 | }) | 92 | }) |
91 | 93 | ||
92 | // Build client javascript and copy bootstrap dependencies | 94 | // Load automatically all the tasks |
93 | grunt.registerTask('build', [], function () { | 95 | require('load-grunt-tasks')(grunt) |
94 | grunt.loadNpmTasks('grunt-sass') | ||
95 | grunt.loadNpmTasks('grunt-browserify') | ||
96 | grunt.loadNpmTasks('grunt-contrib-copy') | ||
97 | grunt.loadNpmTasks('grunt-newer') | ||
98 | 96 | ||
99 | // TODO: SASS --> newer | 97 | // Build client javascript and copy bootstrap dependencies |
100 | grunt.task.run( | 98 | grunt.registerTask('build', [ 'sass:dev', 'newer:browserify:dev', 'newer:copy:dev' ]) |
101 | 'sass:dev', | ||
102 | 'newer:browserify:dev', | ||
103 | 'newer:copy:dev' | ||
104 | ) | ||
105 | }) | ||
106 | 99 | ||
107 | // Start in dev mode (reload front end files without refresh) | 100 | // Start in dev mode (reload front end files without refresh) |
108 | grunt.registerTask('dev', [], function () { | 101 | grunt.registerTask('dev', [ 'sass:dev', 'newer:browserify:dev', 'newer:copy:dev', 'concurrent:dev' ]) |
109 | grunt.loadNpmTasks('grunt-sass') | ||
110 | grunt.loadNpmTasks('grunt-browserify') | ||
111 | grunt.loadNpmTasks('grunt-contrib-watch') | ||
112 | grunt.loadNpmTasks('grunt-express-server') | ||
113 | grunt.loadNpmTasks('grunt-contrib-copy') | ||
114 | grunt.loadNpmTasks('grunt-newer') | ||
115 | |||
116 | // TODO: SASS --> newer | ||
117 | grunt.task.run( | ||
118 | 'sass:dev', | ||
119 | 'newer:browserify:dev', | ||
120 | 'newer:copy:dev', | ||
121 | 'express:dev', | ||
122 | 'watch' | ||
123 | ) | ||
124 | }) | ||
125 | 102 | ||
126 | // Clean build | 103 | // Clean build |
127 | grunt.registerTask('clean', [], function () { | 104 | grunt.registerTask('clean', [], function () { |