-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
45 lines (38 loc) · 972 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
var gulp = require("gulp");
var uglify = require("gulp-uglify");
var connect = require('gulp-connect');
var rename = require("gulp-rename");
var fileinclude = require("gulp-file-include");
gulp.task("app", (cb) => {
gulp
.src(["src/*.html"])
.pipe(
fileinclude({
prefix: "@@",
basepath: "@file",
})
)
.pipe(gulp.dest("dist"));
cb();
});
gulp.task("js", function () {
return (
gulp
.src("src/*.js")
// .pipe(rename({ suffix: '.min' }))
.pipe(uglify())
.pipe(gulp.dest("dist"))
);
});
gulp.task('watch', function () {
gulp.watch('src/*.js', gulp.series('js'));
gulp.watch("src/*.html", gulp.series('app'));
});
gulp.task('server', function () {
connect.server({
port: 8090,
livereload: true,
root: 'src'
})
});
gulp.task("default", gulp.parallel('server', 'watch'));