Registry /
devops / filter-chunk-webpack-plugin
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
FilterChunkWebpackPlugin
✓ import FilterChunkWebpackPlugin from 'filter-chunk-webpack-plugin'
✗ const FilterChunkWebpackPlugin = require('filter-chunk-webpack-plugin').default
ESM default export; CJS require returns the constructor directly (no .default).
FilterChunkWebpackPlugin
✓ const FilterChunkWebpackPlugin = require('filter-chunk-webpack-plugin')
✗ const { FilterChunkWebpackPlugin } = require('filter-chunk-webpack-plugin')
CJS require works, but named destructuring fails because it's a default export.
FilterChunkWebpackPlugin (type)
✓ import type FilterChunkWebpackPlugin from 'filter-chunk-webpack-plugin'
✗ import { FilterChunkWebpackPlugin } from 'filter-chunk-webpack-plugin'
Type imports should use default import style for type-only usage.
Shows basic setup: import the plugin and add an instance to webpack plugins config to exclude .map files from output.
import FilterChunkWebpackPlugin from 'filter-chunk-webpack-plugin';
export default {
// ... webpack config
plugins: [
new FilterChunkWebpackPlugin({
rules: [
{
patterns: '*.map', // remove all .map files
},
],
}),
],
};
Debug
Known issues
breakingVersion 3.0.0 requires Node >=20 and webpack ^5.0.0.fixEnsure Node.js >=20 and webpack ^5 are installed.
affects: >=3.0.0
breakingVersion 2.0.0 dropped Node v6 support and upgraded to webpack 4 compat.fixUpdate Node to >=8 or migrate to v3+ for Node >=20.
affects: >=2.0.0 <3.0.0
gotchaRules are processed as a pipeline in exclude mode; order matters. Each rule filters from the remaining assets.fixArrange rules in intended order, especially when combining exclude and include patterns across multiple rules.
affects: >=0.1.0
gotchaIn include mode, rules are combined with OR logic (union). Assets matching any rule are kept.fixEnsure include rules are not contradictory; consider using exclude mode with negative patterns instead.
affects: >=0.1.0
deprecatedNo known deprecations; the plugin is stable with minimal updates.
Errors
Common errors & fixes
TypeError: FilterChunkWebpackPlugin is not a constructor
Using named import instead of default import or CJS destructuring incorrectly.
fixUse 'import FilterChunkWebpackPlugin from ...' (ESM) or 'const FilterChunkWebpackPlugin = require(...)' (CJS).
Error: Cannot find module 'filter-chunk-webpack-plugin'
Package not installed or Node version incompatible (<20).
fixRun 'npm install filter-chunk-webpack-plugin --save-dev' and ensure Node >=20.
ValidationError: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
Passing invalid options to the plugin constructor.
fixEnsure options object has correct keys (mode, rules, debug) and rules follow the Rule schema.
TypeError: Cannot read properties of undefined (reading 'length')
Using an async pattern function without awaiting the plugin's apply method or not returning a boolean.
fixPattern functions can be async; ensure they return a boolean or Promise<boolean>.
Audit
Dependencies
webpackrequiredPeer dependency; plugin only works with webpack ^5.0.0