Registry / devops / webpack-concat-plugin

webpack-concat-plugin

JSON →
library3.0.0jsnpmunverified

A webpack plugin to concatenate JavaScript files (npm modules, glob patterns, or plain paths) and optionally inject the resulting script into HTML via html-webpack-plugin. Version 3.0.0 requires webpack ^4.0.1. Notable differentiator: allows concat and injection without webpack's JSONP wrapper. Works exclusively with CommonJS (require); no ESM support. Low maintenance cadence, last release in 2019.

npm install webpack-concat-plugin
INSTALL
IMPORT
SIG · WEBPACK-CONCAT-PLU
W
webpack-concat-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.

ConcatPlugin
const ConcatPlugin = require('webpack-concat-plugin');
import ConcatPlugin from 'webpack-concat-plugin';
Package uses CommonJS and does not export an ESM default. Using import will fail unless you use a bundler that supports default interop, but the package is not typed for ESM.
default export
const ConcatPlugin = require('webpack-concat-plugin');
import { ConcatPlugin } from 'webpack-concat-plugin';
There is no named export 'ConcatPlugin'; the entire module exports the class directly.
TypeScript usage
import ConcatPlugin = require('webpack-concat-plugin');
import ConcatPlugin from 'webpack-concat-plugin';
In TypeScript with esModuleInterop: false, use import = require. The package has no type definitions.

Shows basic usage with webpack 4: configure ConcatPlugin to concatenate jQuery, glob files, and a specific dep into a single hashed file.

const ConcatPlugin = require('webpack-concat-plugin'); module.exports = { entry: './index.js', output: { path: 'dist', filename: 'bundle.js' }, plugins: [ new ConcatPlugin({ uglify: false, sourceMap: false, name: 'result', fileName: '[name].[hash:8].js', filesToConcat: ['jquery', './src/lib/**', './dep/dep.js'] }) ] };
Debug
Known issues
breakingVersion 3.0.0 requires webpack ^4.0.1. It will not work with webpack 5 or webpack 3.
fix
If using webpack 5, consider an alternative like webpack-manifest-plugin or manual concat. For webpack 3, use version 2.x.
affects: 3.0.0
deprecatedNode engine restriction: >= 4.8 < 5.0.0 || >= 5.10. This is outdated and may cause issues on modern Node versions (e.g., Node >=12).
fix
Override engine-strict or use a newer alternative. The package may still work but is untested.
affects: 3.0.0
gotchaThe plugin only supports CommonJS require; attempting ES import will fail in pure ESM environments (e.g., Node with 'type': 'module').
fix
Use require() or transpile your config with a bundler that converts ESM to CJS.
affects: all
breakinghtml-webpack-plugin injection may not work with html-webpack-plugin v4+ due to API changes.
fix
Check compatibility: if inject fails, set injectType to 'none' and manually reference the generated file.
affects: >=3.0.0
Errors
Common errors & fixes
Cannot find module 'webpack-concat-plugin'
Package not installed or installed in wrong directory.
fix
Run 'npm install webpack-concat-plugin@3.0.0 --save-dev' in your project root.
TypeError: ConcatPlugin is not a constructor
Using named import instead of default require.
fix
Use 'const ConcatPlugin = require('webpack-concat-plugin');'
Error: The 'filesToConcat' option is required
Missing required filesToConcat configuration.
fix
Add 'filesToConcat: ["some/path.js"]' to the plugin options.
Error: webpack version 5.x is not supported
The plugin is designed for webpack 4.x only.
fix
Downgrade webpack to 4.x or use a different concat plugin (e.g., webpack-concat-plugin does not support webpack 5).
Upgrade
Version history
3.0.0latest on npm
Audit
Dependencies
webpackoptionalpeer dependency required for plugin to operate
webpack-sourcesrequiredused internally for source map and file concatenation
globbyrequiredused to resolve glob patterns in filesToConcat
uglify-jsoptionaloptional minification, only used if uglify option is set
Agent activity
8 hits · last 30 days
node
8
Resources
webpack-concat-plugin — npm install webpack-concat-plugin · libregistry