Skip to content

Commit

Permalink
Allow specifying options to ignore warnings
Browse files Browse the repository at this point in the history
I have a dependency that results in a warning every time it builds (the request of a dependency is an expression). I don't think that there's a way for me to avoid this one, so I'd prefer to be able to specify that I don't want to show warnings.
  • Loading branch information
Kent C. Dodds committed Feb 26, 2015
1 parent 50fc071 commit 50e9fa8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
var path = require('path');
var notifier = require('node-notifier');

var WebpackNotifierPlugin = module.exports = function() {
var WebpackNotifierPlugin = module.exports = function(options) {
this.lastBuildSucceeded = false;
this.options = options || {};
};

WebpackNotifierPlugin.prototype.compileMessage = function(stats) {
var error;
if (stats.hasWarnings()) {
error = stats.compilation.warnings[0];
}
if (stats.hasErrors()) {
error = stats.compilation.errors[0];
}
if (!error && stats.hasWarnings() && !this.options.excludeWarnings) {
error = stats.compilation.warnings[0];
}

if (error) {
try {
Expand Down

0 comments on commit 50e9fa8

Please sign in to comment.