{"id":21972,"library":"rollup-plugin-cpy","title":"rollup-plugin-cpy","description":"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.","status":"active","version":"2.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/paulmelnikow/rollup-plugin-cpy","tags":["javascript","rollup","rollup-plugin","rollup copy","rollup plugin copy"],"install":[{"cmd":"npm install rollup-plugin-cpy","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-cpy","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-cpy","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core library used for file copying","package":"cpy","optional":false}],"imports":[{"note":"Default export; ESM-only. CommonJS require must use .default.","wrong":"const { default: copy } = require('rollup-plugin-cpy')","symbol":"default","correct":"import copy from 'rollup-plugin-cpy'"},{"note":"Named import does not exist; use default import.","wrong":"import { copy } from 'rollup-plugin-cpy'","symbol":"copy","correct":"import copy from 'rollup-plugin-cpy'"},{"note":"TypeScript types not exported; manually type the config as { files: string | string[], dest: string, options?: { verbose?: boolean, cwd?: string, ... } }","wrong":"import { Config } from 'rollup-plugin-cpy'","symbol":"ConfigArray","correct":"// Config is an array of objects or a single object\n// No TypeScript types are provided in this version.\n// Use JSDoc or infer from usage."}],"quickstart":{"code":"// Install: npm i -D rollup-plugin-cpy\n// rollup.config.js\nimport copy from 'rollup-plugin-cpy';\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    dir: 'dist',\n    format: 'cjs'\n  },\n  plugins: [\n    copy({\n      files: ['src/static/**/*', '!src/static/exclude.txt'],\n      dest: 'dist/static',\n      options: { verbose: true }\n    })\n  ]\n};","lang":"javascript","description":"Copies all files from src/static to dist/static, excluding exclude.txt."},"warnings":[{"fix":"Ensure dest directory does not overlap with output dir, or use copy as last plugin.","message":"Files are copied after the bundle is written, so they may overwrite output files if dest overlaps.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Make sure Rollup is configured to handle CJS dependencies (e.g., with @rollup/plugin-commonjs).","message":"The cpy library uses CJS; rollup-plugin-cpy is ESM only, requiring Rollup to handle dependencies.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Pin cpy to v8 in your package.json if issues arise.","message":"The cpy package v9+ changed API; this plugin uses cpy v8 internally, causing potential incompatibility if cpy is updated globally.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Upgrade Node to >=8 and Rollup to >=1.","message":"Version 2.0.0 dropped support for Node.js < 8 and Rollup < 1.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use path.posix.join or manually convert backslashes.","message":"Glob patterns in files should use forward slashes (/) even on Windows.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0':30 '2.0.1':17 '2019':26 'activ':61 'compat':27 'configur':34 'copi':8,45,51,69,72 'cpi':4,14,58 'develop':62 'differenti':42 'file':9 'folder':11 'glob':37 'interfac':35 'javascript':63 'last':23 'latest':20 'leverag':53 'librari':15 'like':47 'log':41 'maintain':57 'packag':59 'plugin':3,6,46,50,67,71 'provid':31 'releas':22 'rollup':2,5,29,49,64,66,68,70 'rollup-plugin':65 'rollup-plugin-copi':48 'rollup-plugin-cpi':1 'simpl':33 'stabl':21 'support':38 'updat':24 'use':12 'verbos':40 'version':16 'well':56 'well-maintain':55","created_at":"2026-04-27T17:02:43.300518+00:00","updated_at":"2026-04-27T17:02:43.300518+00:00","problems":[{"fix":"Run 'npm install cpy' or add cpy to your devDependencies.","cause":"cpy is a peer dependency not installed automatically.","error":"Error: Cannot find module 'cpy'"},{"fix":"Use: const copy = require('rollup-plugin-cpy').default;","cause":"CommonJS require without accessing .default","error":"TypeError: (0 , _rollupPluginCpy.default) is not a function"},{"fix":"Use require() or transpile with Babel/TypeScript.","cause":"Using ES module syntax without transpilation in Node < 9 or without type: 'module'.","error":"Error: Unexpected token: punc (.)"},{"fix":"Upgrade Node to >=12 or remove exports from package.json manually.","cause":"Old Node versions may not resolve package exports properly.","error":"ERR_PACKAGE_PATH_NOT_EXPORTED: Package subpath './package.json' is not defined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/paulmelnikow/rollup-plugin-cpy","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/rollup-plugin-cpy","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-18","next_check":"2026-07-26","install_tag":null}}