Registry / devops / rollup-plugin-copy-glob

rollup-plugin-copy-glob

JSON →
library0.4.1jsnpmunverified

Rollup plugin that copies files and folders during build with glob pattern support and optional renaming. Current stable version is 0.4.1, released with infrequent updates. It is a lightweight alternative to rollup-plugin-copy, offering glob patterns and rename support out of the box, with minimal configuration. It supports Node >=12 and integrates with Rollup's watch mode for file copying on rebuild.

npm install rollup-plugin-copy-glob
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-COPY
R
rollup-plugin-copy-glob
devopsjavascriptv0.4.1
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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 18–223 runs
build_error
glibc
node 18–223 runs
build_error
Code
Verified usage

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

copy
✓ import copy from 'rollup-plugin-copy-glob'
✗ const copy = require('rollup-plugin-copy-glob')
Default export; CommonJS require() may work but ESM import is recommended for Rollup plugins.
CopyOptions
✓ import type { CopyOptions } from 'rollup-plugin-copy-glob'
TypeScript users can import types for options; available since 0.4.0.
CopyTarget
✓ import type { CopyTarget } from 'rollup-plugin-copy-glob'
Type for each copy target object specifying files, dest, rename.

Shows basic setup: copy HTML/CSS files with glob, rename a config file, and copy images recursively with verbose logging and watch mode.

import copy from 'rollup-plugin-copy-glob'; export default { input: 'src/index.js', output: { file: 'dist/bundle.js', format: 'iife', name: 'app' }, plugins: [ copy([ { files: 'src/*.{html,css}', dest: 'dist' }, { files: 'src/config.template', dest: 'dist', rename: 'config.json' }, { files: 'dev/images/**/*.*', dest: 'dist/images' } ], { verbose: true, watch: true }) ] };
Debug
Known issues
gotchaThe plugin only copies files at build start or during watch mode; it does not clean the destination before copying, so outdated files may remain.
fix
Use a separate cleanup plugin like rollup-plugin-delete or manually clean dist before build.
affects: >=0.0.0
deprecatedOption 'watch' is deprecated; use Rollup's built-in watch mode instead.
fix
Remove the 'watch' option; rely on Rollup's --watch flag.
affects: >=0.1.0
breakingIn version 0.1.0, the API changed from copy(files, dest) to copy([...], options).
fix
Update your plugin config to use array of objects with 'files' and 'dest' properties.
affects: >=0.1.0
gotchaWhen using rename, ensure the destination directory exists; the plugin does not create nested directories automatically.
fix
Create the destination directory manually or use a separate mkdirp step.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: copy is not a function
Importing the plugin incorrectly (e.g., using named import instead of default).
fix
Use `import copy from 'rollup-plugin-copy-glob'` (default import).
Error: No files matched with pattern: src/**/*.txt
Glob pattern does not match any existing files.
fix
Verify the path and pattern; check if files exist relative to project root.
Error: ENOENT: no such file or directory, copyfile 'source' -> 'dest'
The destination directory does not exist.
fix
Create the destination directory before running Rollup, or use a plugin that auto-creates directories.
Upgrade
Version history
0.4.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Resources
rollup-plugin-copy-glob — npm install rollup-plugin-copy-glob · libregistry