New upstream version 0.5.0

parent 910bbcc0
......@@ -4,10 +4,18 @@ var Pend = require('pend');
exports.extractRequires = extractRequires;
exports.createBundle = createBundle;
exports.renderBundle = renderBundle;
function createBundle(options, cb) {
var entrySourcePath = options.entrySourcePath;
var outBundlePath = options.outBundlePath;
renderBundle(options, function(err, output) {
if (err) return cb(err);
fs.writeFile(outBundlePath, output, cb);
});
}
function renderBundle(options, cb) {
var entrySourcePath = options.entrySourcePath;
var standalone = options.standalone;
// data structure that is filled up with canonical source path as the key,
......@@ -30,7 +38,7 @@ function createBundle(options, cb) {
if (err) return cb(err);
render(resolvedPath, function(err, output) {
if (err) return cb(err);
fs.writeFile(outBundlePath, output, cb);
cb(null, output);
});
});
});
......@@ -117,7 +125,6 @@ function createBundle(options, cb) {
}
}
function tokenizeSource(source) {
var tokens = [];
var inQuote = false;
......@@ -223,6 +230,8 @@ function extractRequires(source, cb) {
} else if (state === STATE_WANT_RPAREN && token === ')') {
state = STATE_WANT_REQUIRE;
requiresList.push(requireName);
} else if (state === STATE_WANT_RPAREN && token !== ')') {
state = STATE_WANT_REQUIRE;
}
}
cb(null, requiresList);
......
{
"name": "browserify-lite",
"version": "0.3.0",
"version": "0.5.0",
"description": "browserify, minus some of the advanced features and heavy dependencies.",
"main": "index.js",
"scripts": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment