Registry / devops / chunk-rename-webpack-plugin

chunk-rename-webpack-plugin

JSON →
library1.1.1jsnpmunverified

Webpack plugin (v1.1.1, last released 2017) that overrides output.filename and output.chunkFilename on a per-chunk basis. It maps chunk names to custom filename templates, allowing some files to have static names while others include hashes. Works with webpack 1, 2, and 3 (Node 4+). Not maintained for webpack 4+ — consider webpack's built-in asset module or other plugins. Differentiator: simple, explicit mapping of chunk names to filenames without affecting global output config.

npm install chunk-rename-webpack-plugin
INSTALL
IMPORT
SIG · CHUNK-RENAME-WEBPA
C
chunk-rename-webpack-plugin
devopsjavascriptv1.1.1
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.

default
const ChunkRenamePlugin = require('chunk-rename-webpack-plugin');
import ChunkRenamePlugin from 'chunk-rename-webpack-plugin';
Package uses CommonJS, no default export. Use require().
ChunkRenamePlugin
const { ChunkRenamePlugin } = require('chunk-rename-webpack-plugin');
Named import works but unnecessary; the package exports a single constructor.
Plugin usage
new ChunkRenamePlugin({ chunkName: 'filename.js' })
new ChunkRenamePlugin({ pattern: /.../ })
Argument is a plain object mapping chunk names to filename templates, not regex or string.

Shows how to override global filename patterns for specific chunks using the plugin.

const path = require('path'); const ChunkRenamePlugin = require('chunk-rename-webpack-plugin'); module.exports = { entry: { init: './src/init.js', vendor: './src/vendor.js', }, output: { path: path.resolve(__dirname, 'dist'), filename: '[name]-[chunkhash].js', chunkFilename: 'chunk-[name]-[chunkhash].js', }, plugins: [ new ChunkRenamePlugin({ init: 'init.js', login: 'chunk-[name]-page.js', }), ], };
Debug
Known issues
deprecatedPackage not updated since 2017; incompatible with webpack 4 and 5.
fix
Migrate to webpack's built-in output.filename function or asset module rules.
affects: >=1.0.0
gotchaChunk names must exactly match entry keys or async chunk names; case-sensitive.
fix
Verify chunk name spelling in webpack output (e.g., 'login' not 'Login').
affects: >=1.0.0
gotchaOnly works with webpack 1, 2, 3; requires Node >= 4.
fix
Use compatible webpack version or find alternative for newer webpack.
affects: >=1.0.0
breakingRemoves the ability to use [contenthash] or [fullhash] placeholders from webpack 4/5.
fix
Use webpack 4/5 native hashing in output.filename function.
affects: >=1.0.0
Errors
Common errors & fixes
Error: ChunkRenamePlugin is not a constructor
Using import statement (ESM) with a CommonJS-only package.
fix
Replace 'import ChunkRenamePlugin from ...' with 'const ChunkRenamePlugin = require(...)'
Module not found: Error: Can't resolve 'chunk-rename-webpack-plugin'
Package not installed or wrong webpack version (4/5).
fix
Run 'npm install chunk-rename-webpack-plugin --save-dev' or downgrade webpack to 1-3.
Unhandled rejection: TypeError: Cannot read property 'getModules' of undefined
Using plugin with webpack 4+ (API mismatch).
fix
Use webpack 1-3 or a compatible plugin like 'webpack-files-archive-plugin'.
Upgrade
Version history
1.1.1latest on npm
Audit
Dependencies
webpackrequiredPeer dependency; plugin works with webpack 1, 2, and 3 only
Agent activity
8 hits · last 30 days
node
8
Resources
chunk-rename-webpack-plugin — npm install chunk-rename-webpack-plugin · libregistry