Skip to content

Commit

Permalink
🏗 Improve error logging in `build-system/compile/check-for-unknown-de…
Browse files Browse the repository at this point in the history
…ps.js` (#25248)
  • Loading branch information
rsimha committed Oct 25, 2019
1 parent 05e527c commit 19256bd
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions build-system/compile/check-for-unknown-deps.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
*/
'use strict';

const colors = require('ansi-colors');
const log = require('fancy-log');
const through = require('through2');
const {red, cyan} = require('ansi-colors');

/**
* Searches for the identifier "$$module$", which Closure uses to uniquely
Expand All @@ -41,15 +41,11 @@ exports.checkForUnknownDeps = function() {
];

log(
colors.red(
'Unknown dependency found in ' + file.relative + ': ' + match[0]
)
);
cb(
new Error(
'Unknown dependency found in ' + file.relative + ': ' + match[0]
),
file
red('Error:'),
`Unknown dependency ${cyan(match[0])} found in ${cyan(file.relative)}`
);
const err = new Error('Compilation failed due to unknown dependency');
err.showStack = false;
cb(err, file);
});
};

0 comments on commit 19256bd

Please sign in to comment.