-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
31 lines (23 loc) · 864 Bytes
/
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
var gulp = require( 'gulp' );
var requireDir = require( 'require-dir' );
var runSequence = require('run-sequence');
requireDir( './gulp' );
function watchAndRebuild() {
gulp.watch( ['./compile/**/*'], [ 'build' ] );
}
function watchAndRecompile() {
gulp.watch( './component/**/*', [ 'browserify' ] );
gulp.watch( [ './index.html', './index.js' ], [ 'through' ] );
gulp.watch( './style/**/*', [ 'less' ] );
}
gulp.task( 'watch-all', function () {
watchAndRecompile();
watchAndRebuild();
} );
gulp.task('icons', function() {
gulp.src('./assets/*.png').pipe(gulp.dest('./compile/'));
});
gulp.task( 'watch-compile-build', runSequence('compile', 'icons', 'build', 'watch-all') );
gulp.task( 'watch-compile', [ 'build' ], watchAndRecompile );
gulp.task( 'watch-build', [ 'build' ], watchAndRebuild );
gulp.task( 'default', [ 'watch-compile-build' ] );