forked from AutoConX/CoreConX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
49 lines (36 loc) · 1.18 KB
/
gulpfile.js
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
39
40
41
42
43
44
45
46
47
48
49
'use strict';
var gulp = require('gulp'),
livereload = require('gulp-livereload'),
runSequence = require('run-sequence');
// Process our CFML files
gulp.task('cfml', function() {
return gulp.src('./src/**/**')
.pipe( gulp.dest('./dist') );
});
// Process the source for distribution
gulp.task('dist', [ 'cfml' ]);
// Clean our distribution folder
gulp.task('dist:clean', function( cb ) {
var del = require('del');
del( './dist', cb );
});
// Watch our assets, then distribute and deploy when they change
gulp.task('watch', [ 'dist' ], function() {
// This helper lets us run a specific sequence of tasks.
// First, we run the task supplied (like 'html')
// Then we run dist
// Then we check for 'changed' events and reload our shizzle
var watchHelper = function( firstTask, ev ) {
runSequence( firstTask, 'dist', function() {
if ( ev.type === 'changed' ) {
livereload.changed( ev );
}
});
};
livereload.listen();
gulp.watch([ './src/**/**', './test/cfml/**/*.cfc' ], function( ev ) {
watchHelper('cfml', ev );
});
});
// Default task
gulp.task('default', [ 'dist' ]);