-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
46 lines (39 loc) · 1.2 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
var path = require('path');
var gulp = require('gulp');
var concat = require('gulp-concat');
var less = require('gulp-less');
var forever = require('forever-monitor');
var source = require('vinyl-source-stream');
gulp.task('scripts', function() {
var files = [
'./public/scripts/vendors/jquery.min.js',
'./public/scripts/vendors/bootstrap.min.js',
'./public/scripts/vendors/responsive-nav.js',
'./public/scripts/vendors/toastr.min.js',
'./public/scripts/vendors/spin.min.js',
'./public/scripts/app.js'
];
gulp.src(files)
.pipe(concat('bundle.js'))
.pipe(gulp.dest('./public/dist/'))
});
gulp.task('less', function() {
gulp.src('./public/styles/bundle.less')
.pipe(less({ compress: true, yuicompress: true, optimization: 2}))
.pipe(gulp.dest('./public/dist'));
});
gulp.task('watch', function() {
gulp.watch('./public/scripts/*.js', ['scripts']);
gulp.watch('./public/styles/*.less', ['less']);
});
gulp.task('forever', function () {
var child = new (forever.Monitor)('./app.js', {
max: 3,
silent: true,
options: [],
watch: true,
watchDirectory: './'
});
child.start();
});
gulp.task('default', ['scripts', 'less', 'watch', 'forever']);