diff --git a/.gitignore b/.gitignore
index ed32d99..7b030e8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,4 +9,6 @@ ts/typings/
test/result/
-coverage/
\ No newline at end of file
+coverage/
+
+docs/
\ No newline at end of file
diff --git a/dist/gulpbrowser.browserify.js b/dist/gulpbrowser.browserify.js
new file mode 100644
index 0000000..d4bc294
--- /dev/null
+++ b/dist/gulpbrowser.browserify.js
@@ -0,0 +1,20 @@
+///
+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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImd1bHBicm93c2VyLmJyb3dzZXJpZnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsNENBQTRDO0FBQzVDLElBQU8sT0FBTyxXQUFXLHVCQUF1QixDQUFDLENBQUM7QUFDbEQsSUFBSSxVQUFVLEdBQUk7SUFDVixNQUFNLENBQUMsT0FBTyxDQUFDLE9BQU8sQ0FBQyxHQUFHLENBQUMsVUFBQyxJQUFJLEVBQUUsR0FBRyxFQUFFLEVBQUU7UUFDckMsSUFBSSxjQUFjLEdBQUcsVUFBUyxHQUFHLEVBQUUsZUFBZTtZQUM5QyxFQUFFLENBQUMsQ0FBQyxNQUFNLENBQUMsUUFBUSxDQUFDLGVBQWUsQ0FBQyxDQUFDLENBQUEsQ0FBQztnQkFDbEMsSUFBSSxDQUFDLFFBQVEsR0FBRyxlQUFlLENBQUM7WUFDcEMsQ0FBQztZQUFDLElBQUksQ0FBQyxDQUFDO2dCQUNKLE9BQU8sQ0FBQ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B7XG4gICAgICAgICAgICAgICAgICAgIHBsdWdpbnMuYmVhdXR5bG9nLmVycm9yKFwiZ3VscC1icm93c2VyOiAuYnJvd3NlcmlmeSgpIFwiICsgZXJyLm1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjYihudWxsLGZpbGUpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHBsdWdpbnMuYnJvd3NlcmlmeShmaWxlLCB7IGJhc2VkaXI6IGZpbGUuYmFzZSB9KVxuICAgICAgICAgICAgICAgIC5idW5kbGUoYnVuZGxlQ2FsbGJhY2spXG4gICAgICAgIH0pO1xuIH07XG5cbmV4cG9ydCA9IGJyb3dzZXJpZnk7Il0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9
diff --git a/dist/gulpbrowser.plugins.js b/dist/gulpbrowser.plugins.js
new file mode 100644
index 0000000..ff7e111
--- /dev/null
+++ b/dist/gulpbrowser.plugins.js
@@ -0,0 +1,11 @@
+///
+var plugins = {
+ beautylog: require("beautylog"),
+ through: require("through2"),
+ gutil: require("gulp-util"),
+ path: require("path"),
+ browserify: require("browserify")
+};
+module.exports = plugins;
+
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImd1bHBicm93c2VyLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsNENBQTRDO0FBQzVDLElBQUksT0FBTyxHQUFHO0lBQ1YsU0FBUyxFQUFFLE9BQU8sQ0FBQyxXQUFXLENBQUM7SUFDL0IsT0FBTyxFQUFFLE9BQU8sQ0FBQyxVQUFVLENBQUM7SUFDNUIsS0FBSyxFQUFFLE9BQU8sQ0FBQyxXQUFXLENBQUM7SUFDM0IsSUFBSSxFQUFFLE9BQU8sQ0FBQyxNQUFNLENBQUM7SUFDckIsVUFBVSxFQUFFLE9BQU8sQ0FBQyxZQUFZLENBQUM7Q0FDcEMsQ0FBQztBQUVGLGlCQUFTLE9BQU8sQ0FBQyIsImZpbGUiOiJndWxwYnJvd3Nlci5wbHVnaW5zLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8vIDxyZWZlcmVuY2UgcGF0aD1cIi4vdHlwaW5ncy9tYWluLmQudHNcIiAvPlxudmFyIHBsdWdpbnMgPSB7XG4gICAgYmVhdXR5bG9nOiByZXF1aXJlKFwiYmVhdXR5bG9nXCIpLFxuICAgIHRocm91Z2g6IHJlcXVpcmUoXCJ0aHJvdWdoMlwiKSxcbiAgICBndXRpbDogcmVxdWlyZShcImd1bHAtdXRpbFwiKSxcbiAgICBwYXRoOiByZXF1aXJlKFwicGF0aFwiKSxcbiAgICBicm93c2VyaWZ5OiByZXF1aXJlKFwiYnJvd3NlcmlmeVwiKVxufTtcblxuZXhwb3J0ID0gcGx1Z2luczsiXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
diff --git a/dist/index.js b/dist/index.js
new file mode 100644
index 0000000..456b2cb
--- /dev/null
+++ b/dist/index.js
@@ -0,0 +1,9 @@
+///
+var browserify = require("./gulpbrowser.browserify");
+//create the return object
+var gulpBrowser = {
+ browserify: browserify
+};
+module.exports = gulpBrowser;
+
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0QztBQUU1QyxJQUFPLFVBQVUsV0FBVywwQkFBMEIsQ0FBQyxDQUFDO0FBR3hELDBCQUEwQjtBQUMxQixJQUFJLFdBQVcsR0FBTztJQUNsQixVQUFVLEVBQUUsVUFBVTtDQUN6QixDQUFDO0FBR0YsaUJBQVMsV0FBVyxDQUFDIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8vIDxyZWZlcmVuY2UgcGF0aD1cIi4vdHlwaW5ncy9tYWluLmQudHNcIiAvPlxuXG5pbXBvcnQgYnJvd3NlcmlmeSA9IHJlcXVpcmUoXCIuL2d1bHBicm93c2VyLmJyb3dzZXJpZnlcIik7XG5cblxuLy9jcmVhdGUgdGhlIHJldHVybiBvYmplY3RcbnZhciBndWxwQnJvd3NlcjphbnkgPSB7XG4gICAgYnJvd3NlcmlmeTogYnJvd3NlcmlmeVxufTtcblxuXG5leHBvcnQgPSBndWxwQnJvd3NlcjtcbiJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==
diff --git a/index.d.ts b/index.d.ts
deleted file mode 100644
index 532836e..0000000
--- a/index.d.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-///
-declare module GulpBrowserBrowserify {
- function init(): () => any;
-}
-declare var plugins: {
- beautylog: any;
- through: any;
- gutil: any;
- path: any;
- browserify: any;
-};
-declare var gulpBrowser: any;
diff --git a/index.js b/index.js
deleted file mode 100644
index abd8811..0000000
--- a/index.js
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/env node
-
-///
-var GulpBrowserBrowserify;
-(function (GulpBrowserBrowserify) {
- function init() {
- return 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);
- });
- };
- }
- GulpBrowserBrowserify.init = init;
-})(GulpBrowserBrowserify || (GulpBrowserBrowserify = {}));
-///
-///
-var plugins = {
- beautylog: require("beautylog"),
- through: require("through2"),
- gutil: require("gulp-util"),
- path: require("path"),
- browserify: require("browserify")
-};
-//create the return object
-var gulpBrowser = {};
-gulpBrowser.browserify = GulpBrowserBrowserify.init();
-module.exports = gulpBrowser;
diff --git a/package.json b/package.json
index 73962b6..f1316eb 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "gulp-browser",
"version": "1.0.10",
"description": "browserify and other goodies for gulp",
- "main": "index.js",
+ "main": "dist/index.js",
"scripts": {
"test": "(npmts)",
"reinstall": "(rm -r node_modules && npm install)",
@@ -25,14 +25,14 @@
},
"homepage": "https://github.com/pushrocks/gulp-browser",
"dependencies": {
- "beautylog": "2.0.7",
+ "beautylog": "3.1.2",
"browserify": "13.0.0",
"gulp-util": "3.0.7",
"through2": "2.0.1"
},
"devDependencies": {
"gulp": "3.9.1",
- "gulp-function": "1.0.2",
- "npmts": "^2.2.2"
+ "gulp-function": "1.1.1",
+ "npmts": "^3.3.2"
}
}
diff --git a/test/test.d.ts b/test/test.d.ts
deleted file mode 100644
index 55aebb1..0000000
--- a/test/test.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-///
-declare var plugins: {
- beautylog: any;
- gulp: any;
- gulpBrowser: any;
- gulpFunction: any;
-};
diff --git a/test/test.js b/test/test.js
index c98f504..a7c0fdb 100644
--- a/test/test.js
+++ b/test/test.js
@@ -1,10 +1,8 @@
-#!/usr/bin/env node
-
-///
+///
var plugins = {
beautylog: require("beautylog"),
gulp: require("gulp"),
- gulpBrowser: require("../index.js"),
+ gulpBrowser: require("../dist/index.js"),
gulpFunction: require("gulp-function")
};
describe("gulpBrowser", function () {
@@ -22,3 +20,5 @@ describe("gulpBrowser", function () {
});
});
});
+
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0RBQWdEO0FBQ2hELElBQUksT0FBTyxHQUFHO0lBQ1YsU0FBUyxFQUFFLE9BQU8sQ0FBQyxXQUFXLENBQUM7SUFDL0IsSUFBSSxFQUFFLE9BQU8sQ0FBQyxNQUFNLENBQUM7SUFDckIsV0FBVyxFQUFFLE9BQU8sQ0FBQyxrQkFBa0IsQ0FBQztJQUN4QyxZQUFZLEVBQUUsT0FBTyxDQUFDLGVBQWUsQ0FBQztDQUN6QyxDQUFDO0FBRUYsUUFBUSxDQUFD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VscEJyb3dzZXI6IHJlcXVpcmUoXCIuLi9kaXN0L2luZGV4LmpzXCIpLFxuICAgIGd1bHBGdW5jdGlvbjogcmVxdWlyZShcImd1bHAtZnVuY3Rpb25cIilcbn07XG5cbmRlc2NyaWJlKFwiZ3VscEJyb3dzZXJcIixmdW5jdGlvbigpe1xuICAgIGRlc2NyaWJlKFwiLmJyb3dzZXJpZnlcIixmdW5jdGlvbigpe1xuICAgICAgICBpdChcInNob3VsZCBydW4gdGhyb3VnaCBzbW9vdGhseVwiLGZ1bmN0aW9uKGRvbmUpe1xuICAgICAgICAgICAgdGhpcy50aW1lb3V0KDMwMDAwKTtcbiAgICAgICAgICAgIHBsdWdpbnMuZ3VscC50YXNrKCdndWxwQnJvd3Nlck5vcm1hbCcsZnVuY3Rpb24oY2IpIHtcbiAgICAgICAgICAgICAgICB2YXIgc3RyZWFtID0gcGx1Z2lucy5ndWxwLnNyYygnLi90ZXN0L2Jyb3dzZXJpZnlHdWxwVGVzdC5qcycpXG4gICAgICAgICAgICAgICAgICAgIC5waXBlKHBsdWdpbnMuZ3VscEJyb3dzZXIuYnJvd3NlcmlmeSgpKVxuICAgICAgICAgICAgICAgICAgICAucGlwZShwbHVnaW5zLmd1bHAuZGVzdChcIi4vdGVzdC9yZXN1bHQvXCIpKVxuICAgICAgICAgICAgICAgICAgICAucGlwZShwbHVnaW5zLmd1bHBGdW5jdGlvbihkb25lKSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHN0cmVhbTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgcGx1Z2lucy5ndWxwLnN0YXJ0LmFwcGx5KHBsdWdpbnMuZ3VscCwgWydndWxwQnJvd3Nlck5vcm1hbCddKTtcbiAgICAgICAgfSk7XG4gICAgfSk7XG59KTtcbiJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==
diff --git a/test/test.js.map b/test/test.js.map
new file mode 100644
index 0000000..f0fa0f6
--- /dev/null
+++ b/test/test.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,IAAI,OAAO,GAAG;IACV,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC;IAC/B,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC,kBAAkB,CAAC;IACxC,YAAY,EAAE,OAAO,CAAC,eAAe,CAAC;CACzC,CAAC;AAEF,QAAQ,CAAC,aAAa,EAAC;IACnB,QAAQ,CAAC,aAAa,EAAC;QACnB,EAAE,CAAC,6BAA6B,EAAC,UAAS,IAAI;YAC1C,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACpB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAC,UAAS,EAAE;gBAC7C,IAAI,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,8BAA8B,CAAC;qBACxD,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC;qBACtC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;qBACzC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;gBACtC,MAAM,CAAC,MAAM,CAAC;YAClB,CAAC,CAAC,CAAC;YACH,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,mBAAmB,CAAC,CAAC,CAAC;QAClE,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/ts/test.ts b/test/test.ts
similarity index 88%
rename from ts/test.ts
rename to test/test.ts
index ee5e09b..1e31374 100644
--- a/ts/test.ts
+++ b/test/test.ts
@@ -1,8 +1,8 @@
-///
+///
var plugins = {
beautylog: require("beautylog"),
gulp: require("gulp"),
- gulpBrowser: require("../index.js"),
+ gulpBrowser: require("../dist/index.js"),
gulpFunction: require("gulp-function")
};
diff --git a/ts/gulpbrowser.browserify.ts b/ts/gulpbrowser.browserify.ts
new file mode 100644
index 0000000..1e22dac
--- /dev/null
+++ b/ts/gulpbrowser.browserify.ts
@@ -0,0 +1,18 @@
+///
+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;
\ No newline at end of file
diff --git a/ts/gulpbrowser.plugins.ts b/ts/gulpbrowser.plugins.ts
new file mode 100644
index 0000000..93d23a7
--- /dev/null
+++ b/ts/gulpbrowser.plugins.ts
@@ -0,0 +1,10 @@
+///
+var plugins = {
+ beautylog: require("beautylog"),
+ through: require("through2"),
+ gutil: require("gulp-util"),
+ path: require("path"),
+ browserify: require("browserify")
+};
+
+export = plugins;
\ No newline at end of file
diff --git a/ts/index.ts b/ts/index.ts
index 2388545..d5e8467 100644
--- a/ts/index.ts
+++ b/ts/index.ts
@@ -1,18 +1,12 @@
///
-///
-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;
diff --git a/ts/modulebrowserify.ts b/ts/modulebrowserify.ts
deleted file mode 100644
index ec3f532..0000000
--- a/ts/modulebrowserify.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-///
-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)
- });
- };
- }
-}
\ No newline at end of file