Gathering detailed insights and metrics for rollup-plugin-copy-merge
Gathering detailed insights and metrics for rollup-plugin-copy-merge
Gathering detailed insights and metrics for rollup-plugin-copy-merge
Gathering detailed insights and metrics for rollup-plugin-copy-merge
npm install rollup-plugin-copy-merge
Typescript
Module System
Min. Node Version
JavaScript (99.74%)
Shell (0.26%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
5 Stars
69 Commits
2 Forks
1 Watchers
2 Branches
1 Contributors
Updated on Jun 17, 2025
Latest Version
1.0.2
Package Id
rollup-plugin-copy-merge@1.0.2
Unpacked Size
24.05 kB
Size
6.04 kB
File Count
9
Published on
May 10, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
5
4
21
Copy & Merge files and folders, with glob support. This plugin is extended rollup-plugin-copy plugin which support the merge functionality. Thanks #vladshcherbin
1# yarn 2yarn add rollup-plugin-copy-merge --dev 3 4# npm 5npm i rollup-plugin-copy-merge --save-dev
1// rollup.config.js 2import copy from 'rollup-plugin-copy-merge' 3 4export default { 5 input: 'src/index.js', 6 output: { 7 file: 'dist/app.js', 8 format: 'cjs' 9 }, 10 plugins: [ 11 copy({ 12 targets: [ 13 { src: 'src/index.html', dest: 'dist/public' }, 14 { src: ['assets/fonts/arial.woff', 'assets/fonts/arial.woff2'], dest: 'dist/public/fonts' }, 15 { src: 'assets/images/**/*', dest: 'dist/public/images' } 16 { src: 'assets/js/*.js', file: 'dist/public/scripts.js' }, 17 ] 18 }) 19 ] 20}
There are some useful options:
Type: Array
| Default: []
Array of targets to copy. A target is an object with properties:
string
, Array
): Path or glob of what to copystring
, Array
): One or more destinations where to copystring
): destination file where to copy. all source files will merge into this file. (only supports for 'utf8' contents)string
, Function
): Change destination file or folder nameFunction
): Modify file contents (only supports for 'utf8' contents)Each object should have dest or file, and src properties, rename and transform are optional. globby is used inside, check it for glob pattern examples.
Can merge using file
attribute.
1copy({ 2 targets: [{ src: 'assets/polyfill/*.js', file: 'dist/public/polyfill.js' }], 3 flatten: false 4});
1copy({ 2 targets: [{ src: 'src/index.html', dest: 'dist/public' }] 3});
1copy({ 2 targets: [{ src: 'assets/images', dest: 'dist/public' }] 3});
1copy({ 2 targets: [{ src: 'assets/*', dest: 'dist/public' }] 3});
1copy({ 2 targets: [ 3 { 4 src: ['src/index.html', 'src/styles.css', 'assets/images'], 5 dest: 'dist/public' 6 } 7 ] 8});
1copy({ 2 targets: [{ src: ['assets/images/**/*', '!**/*.gif'], dest: 'dist/public/images' }] 3});
1copy({ 2 targets: [ 3 { src: 'src/index.html', dest: 'dist/public' }, 4 { src: 'assets/images/**/*', dest: 'dist/public/images' } 5 ] 6});
1copy({ 2 targets: [{ src: 'src/index.html', dest: ['dist/public', 'build/public'] }] 3});
1copy({ 2 targets: [{ src: 'src/app.html', dest: 'dist/public', rename: 'index.html' }] 3});
1copy({ 2 targets: [ 3 { 4 src: 'assets/docs/*', 5 dest: 'dist/public/docs', 6 rename: (name, extension, src_path) => `${name}-v1.${extension}` 7 } 8 ] 9});
1copy({ 2 targets: [ 3 { 4 src: 'src/index.html', 5 dest: 'dist/public', 6 transform: (contents, src_file_name, src_path) => 7 contents.toString().replace('__SCRIPT__', 'app.js') 8 } 9 ] 10});
Type: boolean
| Default: false
Output copied items to console.
1copy({ 2 targets: [{ src: 'assets/*', dest: 'dist/public' }], 3 verbose: true 4});
Type: string
| Default: buildEnd
Rollup hook the plugin should use. By default, plugin runs when rollup has finished bundling, before bundle is written to disk.
1copy({ 2 targets: [{ src: 'assets/*', dest: 'dist/public' }], 3 hook: 'writeBundle' 4});
Type: boolean
| Default: false
Copy items once. Useful in watch mode.
1copy({ 2 targets: [{ src: 'assets/*', dest: 'dist/public' }], 3 copyOnce: true 4});
Type: boolean
| Default: true
Remove the directory structure of copied files.
1copy({ 2 targets: [{ src: 'assets/**/*', dest: 'dist/public' }], 3 flatten: false 4});
All other options are passed to packages, used inside:
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
2 existing vulnerabilities detected
Details
Reason
4 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 4
Reason
SAST tool is not run on all commits -- score normalized to 2
Details
Reason
Found 0/19 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-06-30
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 More