Registry / devops / rollup-plugin-cpy

rollup-plugin-cpy

JSON →
library2.0.1jsnpmunverified

Rollup plugin for copying files and folders using the cpy library. Version 2.0.1 is the latest stable release, last updated in 2019. Compatible with Rollup >= 1.0. Provides a simple configuration interface with glob support and verbose logging. Differentiated from other copy plugins (like rollup-plugin-copy) by leveraging the well-maintained cpy package. No active development.

npm install rollup-plugin-cpy
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-CPY
R
rollup-plugin-cpy
devopsjavascriptv2.0.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.

default
✓ import copy from 'rollup-plugin-cpy'
✗ const { default: copy } = require('rollup-plugin-cpy')
Default export; ESM-only. CommonJS require must use .default.
copy
✓ import copy from 'rollup-plugin-cpy'
✗ import { copy } from 'rollup-plugin-cpy'
Named import does not exist; use default import.
ConfigArray
✓ // Config is an array of objects or a single object // No TypeScript types are provided in this version. // Use JSDoc or infer from usage.
✗ import { Config } from 'rollup-plugin-cpy'
TypeScript types not exported; manually type the config as { files: string | string[], dest: string, options?: { verbose?: boolean, cwd?: string, ... } }

Copies all files from src/static to dist/static, excluding exclude.txt.

// Install: npm i -D rollup-plugin-cpy // rollup.config.js import copy from 'rollup-plugin-cpy'; export default { input: 'src/index.js', output: { dir: 'dist', format: 'cjs' }, plugins: [ copy({ files: ['src/static/**/*', '!src/static/exclude.txt'], dest: 'dist/static', options: { verbose: true } }) ] };
Debug
Known issues
gotchaFiles are copied after the bundle is written, so they may overwrite output files if dest overlaps.
fix
Ensure dest directory does not overlap with output dir, or use copy as last plugin.
affects: >=1.0.0
gotchaThe cpy library uses CJS; rollup-plugin-cpy is ESM only, requiring Rollup to handle dependencies.
fix
Make sure Rollup is configured to handle CJS dependencies (e.g., with @rollup/plugin-commonjs).
affects: >=2.0.0
deprecatedThe cpy package v9+ changed API; this plugin uses cpy v8 internally, causing potential incompatibility if cpy is updated globally.
fix
Pin cpy to v8 in your package.json if issues arise.
affects: >=2.0.0
breakingVersion 2.0.0 dropped support for Node.js < 8 and Rollup < 1.
fix
Upgrade Node to >=8 and Rollup to >=1.
affects: >=2.0.0
gotchaGlob patterns in files should use forward slashes (/) even on Windows.
fix
Use path.posix.join or manually convert backslashes.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'cpy'
cpy is a peer dependency not installed automatically.
fix
Run 'npm install cpy' or add cpy to your devDependencies.
TypeError: (0 , _rollupPluginCpy.default) is not a function
CommonJS require without accessing .default
fix
Use: const copy = require('rollup-plugin-cpy').default;
Error: Unexpected token: punc (.)
Using ES module syntax without transpilation in Node < 9 or without type: 'module'.
fix
Use require() or transpile with Babel/TypeScript.
ERR_PACKAGE_PATH_NOT_EXPORTED: Package subpath './package.json' is not defined
Old Node versions may not resolve package exports properly.
fix
Upgrade Node to >=12 or remove exports from package.json manually.
Upgrade
Version history
2.0.1latest on npm
Audit
Dependencies
cpyrequiredCore library used for file copying
Agent activity
5 hits · last 30 days
node
4
Resources
rollup-plugin-cpy — npm install rollup-plugin-cpy · libregistry