Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃彈 Improve error logging in build-system/compile/check-for-unknown-deps.js #25248

Merged
merged 1 commit into from
Oct 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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);
});
};