-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
73 lines (57 loc) · 1.54 KB
/
gulpfile.js
File metadata and controls
73 lines (57 loc) · 1.54 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
var gulp = require("gulp");
var browserify = require("browserify");
var source = require("vinyl-source-stream");
var watchify = require("watchify");
var tsify = require("tsify");
var gutil = require("gulp-util");
var connect = require('gulp-connect');
var paths = {
pages: ['src/*html']
};
var watchedBrowserify = watchify(browserify({
basedir: ".",
debug: true,
entries: ['src/main.ts'],
cache: {},
packageCache: {}
}).plugin(tsify));
gulp.task("copy-html", function() {
return gulp.src(paths.pages)
.pipe(gulp.dest("dist"));
});
gulp.task('webserver', function() {
console.log("server: http://localhost:8080/");
connect.server({
livereload: true,
root: 'dist'
});
});
var bundle = function() {
return watchedBrowserify
.bundle()
.pipe(source("bundle.js"))
.pipe(gulp.dest("dist"));
}
var budo = require("budo");
gulp.task('default', ["copy-html", "webserver"], bundle);
watchedBrowserify.on("update", bundle);
watchedBrowserify.on("log", gutil.log);
/*var ts = require("gulp-typescript");
var tsProject = ts.createProject("tsconfig.json");
gulp.task("default", function() {
return tsProject.src()
.pipe(tsProject())
.js.pipe(gulp.dest("dist"));
});*/
/*var budo = require("budo");
gulp.task('default', ["copy-html", "browserify"], function(cb) {
budo('./dist/bundle.js', {
live: true, // live reload
stream: process.stdout, // log to stdout
port: 1773, // use this as the base port
open: true,
}).on('connect', function(ev) {
console.log("yes it is calling...");
})
.on('exit', cb)
})*/