mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-02 02:17:15 +00:00
15 lines
382 B
TypeScript
15 lines
382 B
TypeScript
import { WebpackError } from 'webpack'
|
|
export default class WarningIgnorePlugin {
|
|
filter: (warn: WebpackError) => boolean
|
|
|
|
constructor (filter) {
|
|
this.filter = filter
|
|
}
|
|
|
|
apply (compiler) /* istanbul ignore next */ {
|
|
compiler.hooks.done.tap('warnfix-plugin', (stats) => {
|
|
stats.compilation.warnings = stats.compilation.warnings.filter(this.filter)
|
|
})
|
|
}
|
|
}
|