Skip to content

Commit

Permalink
chore(bundle): fix suppress circular dep warning
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdbradley committed Feb 15, 2018
1 parent e7f97c5 commit 40121d3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/util/logger/logger-rollup.ts
Expand Up @@ -114,18 +114,21 @@ export function createOnWarnFn(config: Config, diagnostics: Diagnostic[], bundle
const previousWarns: {[key: string]: boolean} = {};

return function onWarningMessage(warning: { code: string, importer: string, message: string }) {
if (warning && warning.message in previousWarns) {
if (!warning || warning.message in previousWarns) {
return;
}
if (warning && warning.code) {

previousWarns[warning.message] = true;

if (warning.code) {
if (INGORE_WARNING_CODES.includes(warning.code)) {
return;
}
if (SUPPRESS_WARNING_CODES.includes(warning.code)) {
config.logger.debug(warning.message);
return;
}
}
previousWarns[warning.message] = true;

let label = '';
if (bundleModulesFiles) {
Expand Down

0 comments on commit 40121d3

Please sign in to comment.