[Pkg-javascript-commits] [node-browserify-lite] 01/03: New upstream version 0.5.0
Johannes Schauer
josch at moszumanska.debian.org
Wed Jul 5 18:50:45 UTC 2017
This is an automated email from the git hooks/post-receive script.
josch pushed a commit to branch master
in repository node-browserify-lite.
commit 4e069d6fc50de8dba5ba5a2f21e2dcf99a1c486b
Author: Johannes Schauer <josch at debian.org>
Date: Wed Jul 5 09:09:03 2017 +0200
New upstream version 0.5.0
---
index.js | 15 ++++++++++++---
package.json | 2 +-
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/index.js b/index.js
index 8572b2c..8a01db3 100644
--- a/index.js
+++ b/index.js
@@ -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);
diff --git a/package.json b/package.json
index dfca706..bbebfd0 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"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": {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-browserify-lite.git
More information about the Pkg-javascript-commits
mailing list