start on using browserify

This commit is contained in:
Craig Condon
2014-07-30 11:12:20 -07:00
parent 270350fda6
commit 00fa37fff0
3 changed files with 53 additions and 16 deletions
+29
View File
@@ -0,0 +1,29 @@
var mdeps = require("module-deps"),
through = require("through"),
async = require("async");
function bundle (input, complete) {
async.waterfall([
/**
*/
function resolveDeps () {
var deps = [];
mdeps(input).pipe(through(function (chunk) {
deps.push(chunk);
}, function () {
for (var i = deps.length; i--;) {
console.log(deps);
}
}));
}
]);
}
module.exports = bundle;
+21 -15
View File
@@ -1,17 +1,17 @@
var async = require("async"),
outcome = require("outcome"),
mkdirp = require("mkdirp"),
request = require("request"),
path = require("path"),
fs = require("fs"),
ncp = require("ncp").ncp,
ProgressBar = require("progress"),
child_process = require("child_process"),
glob = require("glob"),
sardines = require("sardines"),
os = require("os"),
targz = require('tar.gz'),
spawn = child_process.spawn;
var async = require("async"),
outcome = require("outcome"),
mkdirp = require("mkdirp"),
request = require("request"),
path = require("path"),
fs = require("fs"),
ncp = require("ncp").ncp,
ProgressBar = require("progress"),
child_process = require("child_process"),
glob = require("glob"),
bundle = require("./bundle"),
os = require("os"),
targz = require('tar.gz'),
spawn = child_process.spawn;
var _log = require("./log"),
@@ -40,10 +40,16 @@ exports.compile = function (options, complete) {
* bundle the application into one script
*/
function combineProject (nc, next) {
/*function combineProject (nc, next) {
nodeCompiler = nc;
_log("bundle %s", options.input);
sardines({ entries: [options.input], platform: "node" }, next);
},*/
function combineProject (nc, next) {
nodeCompiler = nc;
_log("bundle %s", options.input);
bundle(options.input, next);
},
/**
+3 -1
View File
@@ -21,7 +21,9 @@
"colors": "~0.6.2",
"glob": "~3.2.9",
"progress": "~1.1.3",
"tar.gz": "0.1.1"
"tar.gz": "0.1.1",
"module-deps": "^3.5.4",
"through": "^2.3.4"
},
"preferGlobal": "true",
"bin": {