Registry / devops / filemanager-webpack-plugin

filemanager-webpack-plugin

JSON →
library10.0.1jsnpmunverified

Webpack plugin to copy, move, delete, archive (.zip/.tar/.tar.gz), and create directories before and after builds. Current stable version is 8.x (latest published as 10.0.1 but v7+ had alpha releases with breaking changes; v8 introduced new options). Requires Node >=22.14.0 and webpack ^5.0.0. Ships TypeScript definitions. Key differentiator: supports multiple file operations in a single plugin with glob patterns and flat copy options. Alternatives like copy-webpack-plugin only handle copying.

npm install filemanager-webpack-plugin
INSTALL
IMPORT
SIG · FILEMANAGER-WEBPAC
F
filemanager-webpack-plugin
devopsjavascriptv10.0.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.

FileManagerPlugin
import FileManagerPlugin from 'filemanager-webpack-plugin'
const FileManagerPlugin = require('filemanager-webpack-plugin')
ESM default export since v8. For CJS, use require but ensure default export handling.
FileManagerPlugin
const FileManagerPlugin = require('filemanager-webpack-plugin').default
const FileManagerPlugin = require('filemanager-webpack-plugin')
In CJS, the default export is under .default property due to ESM interop.
FileManagerPluginOptions
import type { FileManagerPluginOptions } from 'filemanager-webpack-plugin'
Type-only import available for TypeScript users. The package ships types.

Sets up the plugin to copy assets folder to dist and create a zip archive after build.

const path = require('path'); const FileManagerPlugin = require('filemanager-webpack-plugin').default; module.exports = { entry: './src/index.js', output: { path: path.resolve(__dirname, 'dist'), filename: 'bundle.js', }, plugins: [ new FileManagerPlugin({ events: { onEnd: { copy: [ { source: './src/assets', destination: './dist/assets' }, ], archive: [ { source: './dist', destination: './release.zip' }, ], }, }, }), ], };
Debug
Known issues
breakingUpgrading from v6 to v7: copy with glob now maintains directory structure by default. Use `options.flat: true` to flatten.
fix
Add `options: { flat: true }` to your copy actions if you need flattened output.
affects: >=7.0.0
breakingv7 removed the `cpy` dependency, which may affect copy behavior for glob patterns without `flat` option.
fix
Explicitly set `options.flat` to `true` or `false` to control directory structure preservation.
affects: 7.0.0
gotchaonStart might fire twice in watch mode. Use WatchIgnorePlugin to ignore output directories.
fix
Add `new webpack.WatchIgnorePlugin({ paths: [/copied-directory/] })` to your webpack config.
affects: >=1.0.0
deprecatedThe `runTasksInSeries` option is deprecated as of v8. Tasks are now always run in series.
fix
Remove `runTasksInSeries` from options.
affects: >=8.0.0
Errors
Common errors & fixes
Cannot find module 'filemanager-webpack-plugin'
Package not installed or peer dependency webpack not installed.
fix
npm install filemanager-webpack-plugin --save-dev (ensure webpack is installed)
TypeError: FileManagerPlugin is not a constructor
Using wrong import method (CJS with default export).
fix
Use `const FileManagerPlugin = require('filemanager-webpack-plugin').default;`
Error: Options validation: archive[0].format: 'tar.gz' is not recognized
Using 'tar.gz' as format, but only 'tar' and 'zip' are valid.
fix
Use format: 'tar' with options: { gzip: true } instead.
Upgrade
Version history
10.0.1latest on npm
Audit
Dependencies
webpackrequiredpeer dependency, plugin architecture requires webpack
Agent activity
2 hits · last 30 days
node
2
Resources