Last active
December 22, 2018 00:47
-
-
Save Stuk/6b574049435df532e905 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webpackConfig = { | |
plugins: [ | |
// Plugin to show any webpack warnings and prevent tests from running | |
function () { | |
this.plugin("done", function (stats) { | |
if (stats.compilation.warnings.length) { | |
// Log each of the warnings | |
stats.compilation.warnings.forEach(function (warning) { | |
console.log(warning.message || warning); | |
}); | |
// Pretend no assets were generated. This prevents the tests | |
// from running making it clear that there were warnings. | |
stats.stats = [{ | |
toJson: function () { | |
return this; | |
}, | |
assets: [] | |
}]; | |
} | |
}); | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
here's my solution for webpack v4 - https://gist.github.com/jonesmac/9ef456153c714db56be0ec24b61c6fbb