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-pluginVerified import paths — ran on the pinned version, not inferred.
Shows basic usage with webpack 4: configure ConcatPlugin to concatenate jQuery, glob files, and a specific dep into a single hashed file.
If using webpack 5, consider an alternative like webpack-manifest-plugin or manual concat. For webpack 3, use version 2.x.
Override engine-strict or use a newer alternative. The package may still work but is untested.
Use require() or transpile your config with a bundler that converts ESM to CJS.
Check compatibility: if inject fails, set injectType to 'none' and manually reference the generated file.
Run 'npm install webpack-concat-plugin@3.0.0 --save-dev' in your project root.
Use 'const ConcatPlugin = require('webpack-concat-plugin');'Add 'filesToConcat: ["some/path.js"]' to the plugin options.
Downgrade webpack to 4.x or use a different concat plugin (e.g., webpack-concat-plugin does not support webpack 5).