-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
52 lines (40 loc) · 1.17 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
const bower = require("gulp-bower");
const gulp = require("gulp");
const install = require("gulp-install");
const nodemon = require("gulp-nodemon");
const livereload = require("gulp-livereload");
paths = {
bower: "webapp/vendor",
bowerjson: "./bower.json",
packagejson: "./package.json",
static: "webapp",
scripts: "webapp/**/*.js",
server: "app/**/*.js",
app: "server",
};
gulp.task("bower", function () {
return gulp.src([paths.bowerjson]).pipe(install());
});
gulp.task("npm", function () {
return gulp.src([paths.packagejson]).pipe(install());
});
gulp.task("server", function () {
livereload.listen();
return nodemon({
script: "./app.js",
nodeArgs: ["--harmony"],
watch:[".","./app","./views","./webapp"],
ext:'js html css',
}).on('start', function () {
console.log("start--prepare livereload");
setTimeout(function () {
livereload.reload();
},1000);
});
});
gulp.task("watch", function () {
gulp.watch(paths.bowerjson, ["bower"]);
return gulp.watch(paths.packagejson, ["npm"]);
});
gulp.task("compile", ["bower"]);
gulp.task("default", ["watch", "server"]);