-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
30 lines (24 loc) · 879 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
let gulp = require('gulp'),
gls = require('gulp-live-server'),
path = require('path'),
less = require('gulp-less');
// Start server
gulp.task('serve', () => {
let server = gls.new('./server/index.js', {env: 'development'});
server.start();
// gulp.watch(['./config/{commands,application}.js', './server/{routes,models,lib}/*.js'], (file) => {
// server.notify.apply(server, [file]);
// });
gulp.watch(['./config/{commands,application}.js', './server/{routes,models,lib}/*.js', './server/index.js'], function() {
server.start.bind(server)();
});
});
gulp.task('less', () => {
return gulp.src('./public/less/style.less')
.pipe(less())
.pipe(gulp.dest('./public/css'));
});
gulp.task('watch', () => {
gulp.watch('./server/public/less/**/*.less', gulp.series('less'));
});
gulp.task('default', gulp.parallel('watch', 'serve'));