Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 3 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 9 additions and 6 deletions.
  1. +8 −5 index.js
  2. +1 −1 package.json
View
13 index.js
@@ -81,7 +81,9 @@ module.exports = function (mains, opts) {
(function ap (trs) {
if (trs.length === 0) return done();
- makeTransform(file, trs[0], function (s) {
+ makeTransform(file, trs[0], function (err, s) {
+ if (err) return output.emit('error', err);
+
s.on('error', output.emit.bind(output, 'error'));
s.pipe(concatStream(function (err, data) {
src = data;
@@ -131,17 +133,18 @@ module.exports = function (mains, opts) {
}
function makeTransform (file, tr, cb) {
- if (typeof tr === 'function') return cb(tr(file));
+ if (typeof tr === 'function') return cb(null, tr(file));
var params = { basedir: path.dirname(file) };
nodeResolve(tr, params, function (err, res) {
- if (err) return cb(through());
+ if (err) return cb(err)
- if (!res) return output.emit('error', new Error([
+ if (!res) return cb(new Error([
'cannot find transform module ', tr,
' while transforming ', file
].join('')));
- cb(require(res)(file));
+
+ cb(null, require(res)(file));
});
}
};
View
2 package.json
@@ -1,6 +1,6 @@
{
"name": "module-deps",
- "version": "0.6.0",
+ "version": "0.6.1",
"description": "walk the dependency graph to generate json output that can be fed into browser-pack",
"main": "index.js",
"bin": {

No commit comments for this range

Something went wrong with that request. Please try again.