-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
40 lines (34 loc) · 1.1 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
var gulp = require('gulp'),
config = require('./gulpconfig'),
requireDir = require('require-dir'),
argv = require('yargs').argv,
production = argv.production,
buildTasks = [
'build:bower',
'build:styles',
'build:scripts',
'copy:fonts',
'copy:images',
'build:html',
'copy:nginx'
],
defaultTasks = [
'build'
];
requireDir('./gulptasks');
if (production) {
buildTasks.push('create:cname');
} else {
defaultTasks.push('serve', 'watch');
}
gulp.task('build', buildTasks);
gulp.task('watch', function () {
gulp.watch(config.paths.bower(''), ['build:bower', 'server:reload']);
gulp.watch([config.paths.src.styles_all, config.paths.src.svg_files], ['build:styles', 'server:reload']);
gulp.watch(config.paths.src.scripts_all, ['build:scripts', 'server:reload']);
gulp.watch(config.paths.src.fonts, ['copy:fonts', 'server:reload']);
gulp.watch(config.paths.src.img, ['copy:images', 'server:reload']);
gulp.watch(config.paths.src.templates_all, ['build:html', 'server:reload']);
});
gulp.task('serve', ['server:run', 'server:reload']);
gulp.task('default', defaultTasks);