update deps
This commit is contained in:
18
ts/gulpbrowser.browserify.ts
Normal file
18
ts/gulpbrowser.browserify.ts
Normal file
@ -0,0 +1,18 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import plugins = require("./gulpbrowser.plugins");
|
||||
let browserify = function() {
|
||||
return plugins.through.obj((file, enc, cb) => { //this is the through object that gets returned by gulpBrowser.browserify();
|
||||
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)
|
||||
});
|
||||
};
|
||||
|
||||
export = browserify;
|
10
ts/gulpbrowser.plugins.ts
Normal file
10
ts/gulpbrowser.plugins.ts
Normal file
@ -0,0 +1,10 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var plugins = {
|
||||
beautylog: require("beautylog"),
|
||||
through: require("through2"),
|
||||
gutil: require("gulp-util"),
|
||||
path: require("path"),
|
||||
browserify: require("browserify")
|
||||
};
|
||||
|
||||
export = plugins;
|
16
ts/index.ts
16
ts/index.ts
@ -1,18 +1,12 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
/// <reference path="./modulebrowserify.ts" />
|
||||
|
||||
var plugins = {
|
||||
beautylog: require("beautylog"),
|
||||
through: require("through2"),
|
||||
gutil: require("gulp-util"),
|
||||
path: require("path"),
|
||||
browserify: require("browserify")
|
||||
};
|
||||
import browserify = require("./gulpbrowser.browserify");
|
||||
|
||||
|
||||
//create the return object
|
||||
var gulpBrowser:any = {};
|
||||
var gulpBrowser:any = {
|
||||
browserify: browserify
|
||||
};
|
||||
|
||||
gulpBrowser.browserify = GulpBrowserBrowserify.init();
|
||||
|
||||
module.exports = gulpBrowser;
|
||||
export = gulpBrowser;
|
||||
|
@ -1,19 +0,0 @@
|
||||
/// <reference path="./index.ts" />
|
||||
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();
|
||||
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)
|
||||
});
|
||||
};
|
||||
}
|
||||
}
|
23
ts/test.ts
23
ts/test.ts
@ -1,23 +0,0 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var plugins = {
|
||||
beautylog: require("beautylog"),
|
||||
gulp: require("gulp"),
|
||||
gulpBrowser: require("../index.js"),
|
||||
gulpFunction: require("gulp-function")
|
||||
};
|
||||
|
||||
describe("gulpBrowser",function(){
|
||||
describe(".browserify",function(){
|
||||
it("should run through smoothly",function(done){
|
||||
this.timeout(30000);
|
||||
plugins.gulp.task('gulpBrowserNormal',function(cb) {
|
||||
var stream = plugins.gulp.src('./test/browserifyGulpTest.js')
|
||||
.pipe(plugins.gulpBrowser.browserify())
|
||||
.pipe(plugins.gulp.dest("./test/result/"))
|
||||
.pipe(plugins.gulpFunction(done));
|
||||
return stream;
|
||||
});
|
||||
plugins.gulp.start.apply(plugins.gulp, ['gulpBrowserNormal']);
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user