feat: refactoring project
This commit is contained in:
15
node_modules/webpack/lib/IgnoreWarningsPlugin.js
generated
vendored
15
node_modules/webpack/lib/IgnoreWarningsPlugin.js
generated
vendored
@@ -15,6 +15,7 @@ class IgnoreWarningsPlugin {
|
||||
constructor(ignoreWarnings) {
|
||||
this._ignoreWarnings = ignoreWarnings;
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply the plugin
|
||||
* @param {Compiler} compiler the compiler instance
|
||||
@@ -22,15 +23,11 @@ class IgnoreWarningsPlugin {
|
||||
*/
|
||||
apply(compiler) {
|
||||
compiler.hooks.compilation.tap("IgnoreWarningsPlugin", compilation => {
|
||||
compilation.hooks.processWarnings.tap(
|
||||
"IgnoreWarningsPlugin",
|
||||
warnings => {
|
||||
return warnings.filter(warning => {
|
||||
return !this._ignoreWarnings.some(ignore =>
|
||||
ignore(warning, compilation)
|
||||
);
|
||||
});
|
||||
}
|
||||
compilation.hooks.processWarnings.tap("IgnoreWarningsPlugin", warnings =>
|
||||
warnings.filter(
|
||||
warning =>
|
||||
!this._ignoreWarnings.some(ignore => ignore(warning, compilation))
|
||||
)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user