-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
28 lines (22 loc) · 748 Bytes
/
gulpfile.js
File metadata and controls
28 lines (22 loc) · 748 Bytes
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
"use strict";
var gulp = require("gulp");
var source = require("vinyl-source-stream");
var livereload = require('gulp-livereload');
var browserify = require("browserify");
var watchify = require("watchify");
var to5ify = require("6to5ify");
gulp.task("default", function () {
console.log("First gulp app!");
var b = browserify({ debug: true, fullPaths: true }).add("./main.js");
var bundler = watchify(b);
function rebundle() {
return bundler.bundle()
.pipe(source("bundle.js"))
.pipe(gulp.dest("./public/js")).pipe(livereload());
}
bundler
.transform(to5ify)
.on("update", rebundle);
livereload.listen(35729);
return rebundle();
});