gulp-browser/ts/modulebrowserify.ts

15 lines
540 B
TypeScript
Raw Permalink Normal View History

2015-10-24 18:55:14 +00:00
/// <reference path="./index.ts" />
2015-10-24 16:26:41 +00:00
module GulpBrowserBrowserify {
export function init() {
return function() {
2015-10-24 18:55:14 +00:00
return through.obj((file, enc, cb) => { //this is the trough object that gets returned by gulpBrowser.browserify();
2015-10-26 22:27:33 +00:00
var bundleCallback = function(err, bufferedContent) {
file.contents = bufferedContent;
cb(null,file);
2015-10-24 18:55:14 +00:00
};
2015-10-26 22:27:33 +00:00
browserify(file)
.bundle(bundleCallback)
2015-10-24 16:26:41 +00:00
});
};
}
}