Skip to content

Instantly share code, notes, and snippets.

@shundroid
Last active December 31, 2015 03:22
Show Gist options
  • Save shundroid/901942f07ffc824fbb5a to your computer and use it in GitHub Desktop.
Save shundroid/901942f07ffc824fbb5a to your computer and use it in GitHub Desktop.
var gulp = require("gulp");
var watchify = require("watchify");
var browserify = require("browserify");
var tsify = require("tsify");
var source = require("vinyl-source-stream");
gulp.task("watchify-tsify", function() {
var b = watchify(browserify({
entries: [ "./ts/a.ts", "./ts/b.ts", /* ... */],
cache: {},
packageCache: {}
}));
function runBundle() {
return b.plugin(tsify, {
noImplicitAny: true,
target: "es5"
}).bundle().pipe(source("./all.js")).pipe(gulp.dest("./js/"));
}
b.on("update", runBundle);
b.on("log", function(msg) {
console.log(msg);
});
bundle();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment