Gathering detailed insights and metrics for rollup-plugin-copy
Gathering detailed insights and metrics for rollup-plugin-copy
Gathering detailed insights and metrics for rollup-plugin-copy
Gathering detailed insights and metrics for rollup-plugin-copy
vite-plugin-static-copy
rollup-plugin-copy for vite with dev server support.
rollup-plugin-copy-assets
Copy additional assets into the output directory of your rollup bundle.
@web/rollup-plugin-copy
Rollup plugin which copies asset files while retaining the relative folder structure.
@guanghechen/rollup-plugin-copy
Rollup plugins to copy files and folds (glob supported)
npm install rollup-plugin-copy
Typescript
Module System
Min. Node Version
Node Version
NPM Version
96.5
Supply Chain
98.5
Quality
73.9
Maintenance
100
Vulnerability
98.6
License
JavaScript (100%)
Total Downloads
97,967,812
Last Day
26,523
Last Week
646,899
Last Month
2,884,507
Last Year
26,106,758
273 Stars
129 Commits
55 Forks
3 Watchers
2 Branches
10 Contributors
Updated on May 19, 2025
Minified
Minified + Gzipped
Latest Version
3.5.0
Package Id
rollup-plugin-copy@3.5.0
Unpacked Size
16.19 kB
Size
3.96 kB
File Count
5
NPM Version
9.5.1
Node Version
18.16.0
Published on
Sep 02, 2023
Cumulative downloads
Total Downloads
Last Day
-0.2%
26,523
Compared to previous day
Last Week
-8.5%
646,899
Compared to previous week
Last Month
0.6%
2,884,507
Compared to previous month
Last Year
8.6%
26,106,758
Compared to previous year
Copy files and folders, with glob support.
1# yarn 2yarn add rollup-plugin-copy -D 3 4# npm 5npm install rollup-plugin-copy -D
1// rollup.config.js 2import copy from 'rollup-plugin-copy' 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 ] 17 }) 18 ] 19}
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
Function
): Change destination file or folder nameFunction
): Modify file contentsEach object should have src and dest properties, rename and transform are optional. globby is used inside, check it for glob pattern examples.
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: [{ src: ['src/index.html', 'src/styles.css', 'assets/images'], dest: 'dist/public' }] 3})
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 src: 'assets/docs/*', 4 dest: 'dist/public/docs', 5 rename: (name, extension, fullPath) => `${name}-v1.${extension}` 6 }] 7})
1copy({ 2 targets: [{ 3 src: 'src/index.html', 4 dest: 'dist/public', 5 transform: (contents, filename) => contents.toString().replace('__SCRIPT__', 'app.js') 6 }] 7})
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}) 5
Type: boolean
| Default: false
Copy items synchronous.
1copy({ 2 targets: [{ src: 'assets/*', dest: 'dist/public' }], 3 copySync: 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
Found 5/25 approved changesets -- score normalized to 2
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
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
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
Reason
29 existing vulnerabilities detected
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 More