gulp-browser/index.js

30 lines
1.1 KiB
JavaScript
Raw Normal View History

2015-10-24 18:55:14 +00:00
/// <reference path="./index.ts" />
2015-10-24 16:26:41 +00:00
var GulpBrowserBrowserify;
(function (GulpBrowserBrowserify) {
function init() {
return function () {
//this is the trough object that gets returned by gulpBrowser.browserify();
return through.obj(function (file, enc, cb) {
2015-10-24 18:55:14 +00:00
var content = String(file.contents);
2015-10-24 16:26:41 +00:00
var basedir = file.base;
2015-10-24 18:55:14 +00:00
var bundleCallback = function (err, bundledBuffer) {
};
browserify(content).bundle(bundleCallback);
2015-10-24 16:26:41 +00:00
//run callback function to signal end of plugin process.
return cb(null, file);
});
};
}
GulpBrowserBrowserify.init = init;
})(GulpBrowserBrowserify || (GulpBrowserBrowserify = {}));
/// <reference path="./typings/tsd.d.ts" />
/// <reference path="./modulebrowserify.ts" />
var through = require("through2");
var path = require("path");
var browserify = require("browserify");
2015-10-24 18:55:14 +00:00
var pr = require("pushrocks");
2015-10-24 16:26:41 +00:00
//create the return object
var gulpBrowser = {};
gulpBrowser.browserify = GulpBrowserBrowserify.init();
module.exports = gulpBrowser;