Registry / devops / filter-chunk-webpack-plugin

filter-chunk-webpack-plugin

JSON →
library3.0.0jsnpmunverified

A webpack plugin (v3.0.0) that filters and excludes assets from final output before emission, using flexible pattern rules (glob, RegExp, or custom functions). Supports include/exclude modes, debug logging, and pipelined rule processing. Requires Node >=20 and webpack ^5, ships TypeScript types. Differentiated by its rule-based pipeline and support for async filter functions. Releases are stable with irregular cadence.

npm install filter-chunk-webpack-plugin
INSTALL
IMPORT
SIG · FILTER-CHUNK-WEBPA
F
filter-chunk-webpack-plugin
devopsjavascriptv3.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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
musl
node 18226 runs
build_error
glibc
node 18226 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.
fix
Ensure 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.
fix
Update 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.
fix
Arrange 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.
fix
Ensure 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.
fix
Use '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).
fix
Run '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.
fix
Ensure 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.
fix
Pattern functions can be async; ensure they return a boolean or Promise<boolean>.
Upgrade
Version history
3.0.0latest on npm
Audit
Dependencies
webpackrequiredPeer dependency; plugin only works with webpack ^5.0.0
Agent activity
2 hits · last 30 days
node
2
Resources
filter-chunk-webpack-plugin — npm install filter-chunk-webpack-plugin · libregistry