{"id":20764,"library":"webpack-filter-warnings-plugin","title":"webpack-filter-warnings-plugin","description":"Webpack plugin that allows you to filter out specific warnings from webpack compilation output. Current stable version is 1.2.1, but it has not been updated since 2018 and only officially supports webpack 2, 3, and 4 (webpack 5 is not supported). This plugin is useful for suppressing unwanted warnings, but users on webpack 5 should consider alternatives like `ClientConfigPlugin` with built-in warning filtering or `webpack-fail-plugin` for different behavior. Note that it does not work with webpack 5 and may have stale peer dependencies.","status":"maintenance","version":"1.2.1","language":"javascript","source_language":"en","source_url":"https://github.com/mattlewis92/webpack-filter-warnings-plugin","tags":["javascript","webpack plugin"],"install":[{"cmd":"npm install webpack-filter-warnings-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add webpack-filter-warnings-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add webpack-filter-warnings-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; plugin hooks into webpack compilation lifecycle","package":"webpack","optional":false}],"imports":[{"note":"This package does not provide an ESM export; must use CommonJS require.","wrong":"import FilterWarningsPlugin from 'webpack-filter-warnings-plugin';","symbol":"default","correct":"const FilterWarningsPlugin = require('webpack-filter-warnings-plugin');"},{"note":"Correct import is the default export via require, not a named import.","wrong":"import { FilterWarningsPlugin } from 'webpack-filter-warnings-plugin';","symbol":"FilterWarningsPlugin","correct":"const FilterWarningsPlugin = require('webpack-filter-warnings-plugin');"},{"note":"The exclude option is passed to the constructor, not a method.","wrong":"plugins: [new FilterWarningsPlugin.exclude(/someWarning/)]","symbol":"plugin usage in webpack config","correct":"plugins: [new FilterWarningsPlugin({ exclude: /someWarning/ })]"}],"quickstart":{"code":"const FilterWarningsPlugin = require('webpack-filter-warnings-plugin');\n\nmodule.exports = {\n  // other webpack config...\n  plugins: [\n    new FilterWarningsPlugin({\n      exclude: /critical dependency/i\n    })\n  ]\n};","lang":"javascript","description":"Shows how to use commonjs require to import and configure the plugin to exclude warnings matching a regex."},"warnings":[{"fix":"Use webpack 4 or older, or switch to a different warning filtering approach for webpack 5 (e.g., custom plugin using webpack 5's infrastructure).","message":"Webpack 5 not supported","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Consider using alternatives like `webpack-fail-plugin` or built-in webpack options.","message":"Package has not been updated since 2018","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use require() instead of import.","message":"Requires CommonJS; no ESM support","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use const FilterWarningsPlugin = require('webpack-filter-warnings-plugin');","cause":"Using ESM import syntax which returns the module object, not the constructor.","error":"TypeError: FilterWarningsPlugin is not a constructor"},{"fix":"Run npm install webpack-filter-warnings-plugin --save-dev","cause":"Package not installed or incorrect import path.","error":"Error: Cannot find module 'webpack-filter-warnings-plugin'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}