replace browserify with sardines

This commit is contained in:
Craig Condon
2013-04-09 13:37:45 -07:00
parent bedcdfe26f
commit 4866e04c13
6 changed files with 26 additions and 16 deletions
+1
View File
@@ -0,0 +1 @@
console.log("hello browser!");
Regular → Executable
+10 -1
View File
@@ -1 +1,10 @@
console.log("hello world!!");
var http = require("http"),
port = 1337;
console.log(process.argv);
console.log("started HTTP server on port %d", 1337);
http.createServer(function(req, res) {
res.end("Hello World!!");
}).listen(port);
Regular → Executable
+1 -1
View File
@@ -1,2 +1,2 @@
all:
nexe -i ./index.js -o ./hello-world.nex -r 0.8.18
nexe -i ./ -o ./hello-world.nex -r 0.8.18
+4
View File
@@ -0,0 +1,4 @@
{
"main": "./index.js",
"browser": "./index.js"
}
+7 -11
View File
@@ -8,8 +8,8 @@ child_process = require("child_process"),
exec = child_process.exec,
spawn = child_process.spawn,
sprintf = require("sprintf").sprintf,
browserify = require("browserify"),
ncp = require("ncp").ncp;
ncp = require("ncp").ncp,
sardines = require("sardines");
/**
*/
@@ -37,18 +37,14 @@ exports.compile = function(args, next) {
on.success(function(node) {
console.log("making application bundle with %s", args.input);
this.node = node;
var b = browserify();
b.addEntry(args.input);
this(null, b.bundle());
sardines({ entries: [args.input], platform: "node" }, this);
}),
/**
* 3. write the file into the node libs directory
*/
on.success(function(bundle) {
console.log("writing application bundle");
fs.writeFile(this.nexePath = path.join(this.node.dir, "lib", "nexe.js"), bundle, "utf8", this);
on.success(function(content) {
console.log("writing application bundle: \n\n%s\n\n", content);
fs.writeFile(this.nexePath = path.join(this.node.dir, "lib", "nexe.js"), content, "utf8", this);
}),
/**
+3 -3
View File
@@ -2,7 +2,7 @@
"author": "Craig Condon <craig.j.condon@gmail.com>",
"name": "nexe",
"description": "Roll node.s applications into a single executable",
"version": "0.1.2",
"version": "0.2.1",
"repository": {
"type": "git",
"url": "git://github.com/crcn/nexe.git"
@@ -13,10 +13,10 @@
"sprintf": "0.1.x",
"step": "0.0.x",
"optimist": "0.3.x",
"browserify": "1.16.x",
"request": "2.12.x",
"ncp": "0.2.x",
"mkdirp": "0.3.x"
"mkdirp": "0.3.x",
"sardines": "0.4.x"
},
"bin": {
"nexe": "./bin/nexe"