Registry / devops / filemanager-plugin

filemanager-plugin

JSON →
library2.9.0jsnpmunverified

A file management plugin for webpack, rollup, and Vite that supports delete, copy, move, rename, zip/unzip operations before and after builds. Current stable version is 2.9.0. It provides two event-driven APIs: a simple 'events' pattern for common build lifecycle hooks (start/end) and a more flexible 'customHooks' pattern that allows binding to arbitrary compiler hooks (e.g., webpack's compile, rollup's generateBundle). Supports .zip, .tar, .tar.gz archives. Unlike similar plugins (e.g., copy-webpack-plugin, webpack-archive-plugin), filemanager-plugin bundles multiple file operations in one plugin, includes rollup and Vite support. Release cadence is irregular; last update was in 2023. Requires Node >= 14, webpack >= 4.

devops
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Package uses CommonJS; named export WebpackFilemanager for webpack. Rollup uses RollupFilemanager. No default export.

const { WebpackFilemanager } = require('filemanager-plugin');

CommonJS named export for rollup.

const { RollupFilemanager } = require('filemanager-plugin');

CommonJS named export for Vite. Does not exist in README but listed in package exports; verify version 2.9.0.

const { ViteFilemanager } = require('filemanager-plugin');

Configures filemanager-plugin in webpack to delete the dist folder before build and zip a file after build.

const { WebpackFilemanager } = require('filemanager-plugin'); module.exports = { plugins: [ new WebpackFilemanager({ events: { start: { delete: { items: ['./dist'] } }, end: { zip: { items: [ { source: './src/demo0.zip', destination: './dest/demo0', type: 'zip' } ] } } } }) ] };
Debug
Known footguns
gotchaWhen customHooks is set, events are ignored entirely.
deprecatedThe 'type' field in zip items may be deprecated; some users report unzip operations failing without explicit type.
gotchaFile paths are relative to the project root, not the config file location.
gotchaThe package uses CommonJS and does not provide ESM exports; cannot be imported with import syntax in default bundler setups.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
9 hits · last 30 days
gptbot
3
ahrefsbot
3
claudebot
3
Resources