-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
53 lines (42 loc) · 1.36 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
50
51
52
53
var gulp = require('gulp');
var concat = require('gulp-concat');
var less = require('gulp-less');
var process = require('child_process');
gulp.task('fonts', function(){
return gulp.src('./node_modules/bootstrap/fonts/*.{ttf,woff,woff2,eot,svg}')
.pipe(gulp.dest('typeseam/static/fonts/'))
});
gulp.task('img', function(){
return gulp.src('./frontend/img/*.{png,jpg}')
.pipe(gulp.dest('typeseam/static/img/'))
});
gulp.task('voicemail', function(){
return gulp.src('./frontend/voicemail/*')
.pipe(gulp.dest('typeseam/static/voicemail/'))
});
gulp.task('less_dev', function(){
return gulp.src('./frontend/less/main.less')
.pipe(less())
.pipe(gulp.dest('./typeseam/static/css/'));
});
jsfiles = [
'./node_modules/jquery/dist/jquery.js',
'./frontend/js/main.js',
];
gulp.task('js_dev', function(){
return gulp.src(jsfiles)
.pipe(concat('main.js'))
.pipe(gulp.dest('./typeseam/static/js/'));
})
gulp.task('watch', function(){
gulp.watch('./frontend/js/**/*.js', ['js_dev']);
gulp.watch('./frontend/less/**/*.less', ['less_dev']);
})
gulp.task('flask', function(){
var spawn = process.spawn;
console.info('Starting flask server');
var PIPE = {stdio: 'inherit'};
spawn('python', ['manage.py','server'], PIPE);
});
gulp.task('build', ['fonts', 'img', 'voicemail', 'less_dev', 'js_dev'])
gulp.task('default', ['flask', 'build', 'watch'])