21 lines
2.7 KiB
JavaScript
21 lines
2.7 KiB
JavaScript
|
/// <reference path="./typings/main.d.ts" />
|
||
|
var plugins = require("./gulpbrowser.plugins");
|
||
|
var browserify = function () {
|
||
|
return plugins.through.obj(function (file, enc, cb) {
|
||
|
var bundleCallback = function (err, bufferedContent) {
|
||
|
if (Buffer.isBuffer(bufferedContent)) {
|
||
|
file.contents = bufferedContent;
|
||
|
}
|
||
|
else {
|
||
|
plugins.beautylog.error("gulp-browser: .browserify() " + err.message);
|
||
|
}
|
||
|
cb(null, file);
|
||
|
};
|
||
|
plugins.browserify(file, { basedir: file.base })
|
||
|
.bundle(bundleCallback);
|
||
|
});
|
||
|
};
|
||
|
module.exports = browserify;
|
||
|
|
||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImd1bHBicm93c2VyLmJyb3dzZXJpZnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsNENBQTRDO0FBQzVDLElBQU8sT0FBTyxXQUFXLHVCQUF1QixDQUFDLENBQUM7QUFDbEQsSUFBSSxVQUFVLEdBQUk7SUFDVixNQUFNLENBQUMsT0FBTyxDQUFDLE9BQU8sQ0FBQyxHQUFHLENBQUMsVUFBQyxJQUFJLEVBQUUsR0FBRyxFQUFFLEVBQUU7UUFDckMsSUFBSSxjQUFjLEdBQUcsVUFBUyxHQUFHLEVBQUUsZUFBZTtZQUM5QyxFQUFFLENBQUMsQ0FBQyxNQUFNLENBQUMsUUFBUSxDQUFDLGVBQWUsQ0FBQyxDQUFDLENBQUEsQ0FBQztnQkFDbEMsSUFBSSxDQUFDLFFBQVEsR0FBRyxlQUFlLENBQUM7WUFDcEMsQ0FBQztZQUFDLElBQUksQ0FBQyxDQUFDO2dCQUNKLE9BQU8sQ0FBQyxTQUFTLENBQUMsS0FBSyxDQUFDLDhCQUE4QixHQUFHLEdBQUcsQ0FBQyxPQUFPLENBQUMsQ0FBQztZQUMxRSxDQUFDO1l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