gulp-browser/ts/modulebrowserify.ts

19 lines
790 B
TypeScript
Raw 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() {
return plugins.through.obj((file, enc, cb) => { //this is the through object that gets returned by gulpBrowser.browserify();
2015-10-26 22:27:33 +00:00
var bundleCallback = function(err, bufferedContent) {
if (Buffer.isBuffer(bufferedContent)){
file.contents = bufferedContent;
} else {
plugins.beautylog.error("gulp-browser: .browserify() " + err.message);
}
2015-10-26 22:27:33 +00:00
cb(null,file);
2015-10-24 18:55:14 +00:00
};
2016-01-31 23:07:53 +00:00
plugins.browserify(file, { basedir: file.base })
2015-10-26 22:27:33 +00:00
.bundle(bundleCallback)
2015-10-24 16:26:41 +00:00
});
};
}
}