Gathering detailed insights and metrics for filemanager-webpack-plugin
Gathering detailed insights and metrics for filemanager-webpack-plugin
Gathering detailed insights and metrics for filemanager-webpack-plugin
Gathering detailed insights and metrics for filemanager-webpack-plugin
Copy, move, archive (zip/tar/tar.gz), delete files and directories before and after Webpack builds. Win32/Mac/*Nix supported
npm install filemanager-webpack-plugin
Typescript
Module System
Min. Node Version
Node Version
NPM Version
87.1
Supply Chain
70.1
Quality
74.2
Maintenance
100
Vulnerability
97
License
JavaScript (99.43%)
Shell (0.57%)
Total Downloads
24,218,850
Last Day
3,712
Last Week
102,804
Last Month
559,504
Last Year
7,325,414
MIT License
466 Stars
287 Commits
35 Forks
5 Watchers
4 Branches
15 Contributors
Updated on Jun 25, 2025
Minified
Minified + Gzipped
Latest Version
8.0.0
Package Id
filemanager-webpack-plugin@8.0.0
Unpacked Size
83.10 kB
Size
14.93 kB
File Count
16
NPM Version
9.1.1
Node Version
14.21.1
Cumulative downloads
Total Downloads
Last Day
-12.1%
3,712
Compared to previous day
Last Week
-4.9%
102,804
Compared to previous week
Last Month
-21.3%
559,504
Compared to previous month
Last Year
7%
7,325,414
Compared to previous year
This Webpack plugin allows you to copy, archive (.zip/.tar/.tar.gz), move, delete files and directories before and after builds
1npm install filemanager-webpack-plugin --save-dev 2# or 3yarn add filemanager-webpack-plugin --dev
1// webpack.config.js: 2 3const FileManagerPlugin = require('filemanager-webpack-plugin'); 4 5export default { 6 // ...rest of the config 7 plugins: [ 8 new FileManagerPlugin({ 9 events: { 10 onEnd: { 11 copy: [ 12 { source: '/path/fromfile.txt', destination: '/path/tofile.txt' }, 13 { source: '/path/**/*.js', destination: '/path' }, 14 ], 15 move: [ 16 { source: '/path/from', destination: '/path/to' }, 17 { source: '/path/fromfile.txt', destination: '/path/tofile.txt' }, 18 ], 19 delete: ['/path/to/file.txt', '/path/to/directory/'], 20 mkdir: ['/path/to/directory/', '/another/directory/'], 21 archive: [ 22 { source: '/path/from', destination: '/path/to.zip' }, 23 { source: '/path/**/*.js', destination: '/path/to.zip' }, 24 { source: '/path/fromfile.txt', destination: '/path/to.zip' }, 25 { source: '/path/fromfile.txt', destination: '/path/to.zip', format: 'tar' }, 26 { 27 source: '/path/fromfile.txt', 28 destination: '/path/to.tar.gz', 29 format: 'tar', 30 options: { 31 gzip: true, 32 gzipOptions: { 33 level: 1, 34 }, 35 globOptions: { 36 // https://github.com/Yqnn/node-readdir-glob#options 37 dot: true, 38 }, 39 }, 40 }, 41 ], 42 }, 43 }, 44 }), 45 ], 46};
1new FileManagerPlugin({ 2 events: { 3 onStart: {}, 4 onEnd: {}, 5 }, 6 runTasksInSeries: false, 7 runOnceInWatchMode: false, 8});
onStart
: Commands to execute before Webpack begins the bundling processNote:
OnStart might execute twice for file changes in webpack context.
1new webpack.WatchIgnorePlugin({
2 paths: [/copied-directory/],
3});
onEnd
: Commands to execute after Webpack has finished the bundling processCopy individual files or entire directories from a source folder to a destination folder. Also supports glob pattern.
1[ 2 { source: '/path/from', destination: '/path/to' }, 3 { 4 source: '/path/**/*.js', 5 destination: '/path', 6 options: { 7 flat: false, 8 preserveTimestamps: true, 9 overwrite: true, 10 }, 11 globOptions: { 12 dot: true, 13 }, 14 }, 15 { source: '/path/fromfile.txt', destination: '/path/tofile.txt' }, 16 { source: '/path/**/*.{html,js}', destination: '/path/to' }, 17 { source: '/path/{file1,file2}.js', destination: '/path/to' }, 18];
Options
string
] - a file or a directory or a globstring
] - a file or a directory.object
] - copy optionsobject
] - options to forward to glob options(See available options here)Caveats
glob
, destination must be a directoryfile
and destination is a directory, the file will be copied into the directoryDelete individual files or entire directories. Also supports glob pattern
1['/path/to/file.txt', '/path/to/directory/', '/another-path/to/directory/**.js'];
or
1[ 2 { 3 source: '/path/to/file.txt', 4 options: { 5 force: true, 6 }, 7 }, 8];
Move individual files or entire directories.
1[ 2 { source: '/path/from', destination: '/path/to' }, 3 { source: '/path/fromfile.txt', destination: '/path/tofile.txt' }, 4];
Options
string
] - a file or a directory or a globstring
] - a file or a directory.Create a directory path with given path
1['/path/to/directory/', '/another/directory/'];
Archive individual files or entire directories. Defaults to .zip unless 'format' and 'options' provided. Uses node-archiver
1[ 2 { source: '/path/from', destination: '/path/to.zip' }, 3 { source: '/path/**/*.js', destination: '/path/to.zip' }, 4 { source: '/path/fromfile.txt', destination: '/path/to.zip' }, 5 { source: '/path/fromfile.txt', destination: '/path/to.zip', format: 'tar' }, 6 { 7 source: '/path/fromfile.txt', 8 destination: '/path/to.tar.gz', 9 format: 'tar', // optional 10 options: { 11 // see https://www.archiverjs.com/docs/archiver 12 gzip: true, 13 gzipOptions: { 14 level: 1, 15 }, 16 globOptions: { 17 // https://github.com/Yqnn/node-readdir-glob#options 18 dot: true, 19 }, 20 }, 21 }, 22];
string
] - a file or a directory or a globstring
] - a file.string
] - Optional. Defaults to extension in destination filename.object
] - Refer https://www.archiverjs.com/archiverIf you need to preserve the order in which operations will run you can set the onStart and onEnd events to be Arrays. In this example below, in the onEnd event the copy action will run first, and then the delete after:
1{ 2 onEnd: [ 3 { 4 copy: [{ source: './dist/bundle.js', destination: './newfile.js' }], 5 }, 6 { 7 delete: ['./dist/bundle.js'], 8 }, 9 ]; 10}
boolean
] - Run tasks in series. Defaults to falseboolean
] - The onStart
event will be run only once in watch mode. Defaults to falseFor Example, the following will run one after the other
1copy: [ 2 { source: 'dist/index.html', destination: 'dir1/' }, 3 { source: 'dir1/index.html', destination: 'dir2/' }, 4];
string
] - The directory, an absolute path, for resolving files. Defaults to webpack context.No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
3 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
Found 2/23 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn Morefilemanager-plugin
Filemanager-plugin allows you to delete, zip/unzip(.zip/.tar/.tar.gz), move, rename, copy files or directories before and after webpack/rollup builds. Also, you can customize the lifecycle of webpack or rollup during building.
filemanager-webpack-plugin-fixed
This Webpack plugin allows you to copy, archive (.zip), move, delete files and directories before and after builds
filemanager-plus-webpack-plugin
This Webpack plugin allows you to copy, archive (.zip), move, delete files and directories before and after builds
filemanager-vue2-dist-zip
使用filemanager-webpack-plugin2.0.5版本vue2打包dist包之后生成zip压缩包