-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
38 lines (36 loc) · 1.05 KB
/
gulpfile.js
File metadata and controls
38 lines (36 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
var gulp = require('gulp')
, gutil = require('gulp-util')
, Promise = require("bluebird")
;
//require gulp tasks
require('./gulp');
//============================
//task to init the dev env for static assets
gulp.task('dev', ['init'], function () {
return new Promise(function (resole) {
gutil.log('Starting watch css/js tasks...');
gulp.start('css.watch', 'js.watch');
resole(true);
}).then(function() {
gutil.log('Gulp development initialization finished.');
});
});
//dev task to watch less/js files to automatically recompile files
gulp.task('watch', function () {
gulp.start('css.watch', 'js.watch');
});
//init the static assets without watch tasks
gulp.task('init', ['css', 'js'], function () {
return new Promise(function (resole) {
gutil.log('Initializing static assets finished.');
resole(true);
});
});
//should for prod
gulp.task('assets', ['css', 'js', 'img', 'html', 'font', 'ejs', 'json'], function () {
gulp.start('rev');
});
// Default task
gulp.task('default', ['clean'], function () {
gulp.start('assets');
});