Registry / devops / merge-files-webpack-plugin

merge-files-webpack-plugin

JSON →
library1.1.2jsnpmunverified

This webpack plugin merges multiple files output by extract-text-webpack-plugin (e.g., per-entry CSS files) into a single file. Version 1.1.2 is the latest; no new releases and no activity on GitHub since 2018. It requires webpack 2+ and extract-text-webpack-plugin 2+. Useful for combining CSS from multiple entries, but limited to legacy webpack setups. Alternative: mini-css-extract-plugin (webpack 4+).

npm install merge-files-webpack-plugin
INSTALL
IMPORT
SIG · MERGE-FILES-WEBPAC
M
merge-files-webpack-plugin
devopsjavascriptv1.1.2
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.

MergeFilesPlugin
const MergeFilesPlugin = require('merge-files-webpack-plugin');
CommonJS usage typical for webpack configs; no ESM or TypeScript types available.
MergeFilesPlugin
import MergeFilesPlugin from 'merge-files-webpack-plugin';
import { MergeFilesPlugin } from 'merge-files-webpack-plugin';
This package uses a default export, so named import will fail.

Merges per-entry CSS files from extract-text-webpack-plugin into one combined.css, deleting intermediate files.

const path = require('path'); const MergeFilesPlugin = require('merge-files-webpack-plugin'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); module.exports = { entry: { a: './src/entryA.js', b: './src/entryB.js' }, output: { path: path.resolve(__dirname, 'dist'), filename: '[name].js' }, module: { rules: [ { test: /\.css$/, use: ExtractTextPlugin.extract({ use: 'css-loader' }) } ] }, plugins: [ new ExtractTextPlugin({ filename: '[name].style.css' }), new MergeFilesPlugin({ filename: 'combined.css', test: /\.css$/, deleteSourceFiles: true }) ] };
Debug
Known issues
deprecatedextract-text-webpack-plugin is deprecated in webpack 4+; use mini-css-extract-plugin instead.
fix
Migrate to mini-css-extract-plugin and remove merge-files-webpack-plugin (mini-css-extract-plugin supports merging via configuration).
affects: >=4.0
gotchaThe filename option in MergeFilesPlugin must not include [name] or other webpack placeholders; it is the final output filename.
fix
Use a static string like 'css/bundle.css' instead of '[name].bundle.css'.
affects: >=1.0
gotchaIf test option is omitted, it defaults to the filename value. This can cause incorrect files to be merged if filename is not specific enough.
fix
Always provide an explicit test (RegExp or string) that matches only the files you intend to merge.
affects: >=1.0
Errors
Common errors & fixes
Error: Cannot find module 'merge-files-webpack-plugin'
Package not installed or mistyped as 'merge-text-webpack-plugin' (see README error).
fix
Run: npm install merge-files-webpack-plugin --save-dev (correct name).
TypeError: MergeFilesPlugin is not a constructor
Using named import instead of default import in a CommonJS context.
fix
Use: const MergeFilesPlugin = require('merge-files-webpack-plugin');
Upgrade
Version history
1.1.2latest on npm
Audit
Dependencies
extract-text-webpack-pluginrequiredRequired as the source plugin that extracts text files per entry.
Agent activity
2 hits · last 30 days
node
2
Resources
merge-files-webpack-plugin — npm install merge-files-webpack-plugin · libregistry