{"id":21965,"library":"rollup-plugin-copy-merge","title":"rollup-plugin-copy-merge","description":"A Rollup plugin that copies files and folders with glob support and adds file merging capability on top of rollup-plugin-copy. Current version 1.0.3, stable, maintained. Key differentiator: allows merging multiple source files into a single destination file via the 'file' target property, unlike its predecessor. Requires Node >=14, ships TypeScript types, and relies on fs-extra, globby, and colorette as peer dependencies.","status":"active","version":"1.0.3","language":"javascript","source_language":"en","source_url":"https://github.com/syJSdev/rollup-plugin-copy-merge","tags":["javascript","rollup","rollup-plugin","copy","cp","asset","assets","file","files","typescript"],"install":[{"cmd":"npm install rollup-plugin-copy-merge","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-copy-merge","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-copy-merge","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency for TypeScript type definitions","package":"@types/fs-extra","optional":true},{"reason":"peer dependency for coloring console output","package":"colorette","optional":false},{"reason":"peer dependency for enhanced file system operations","package":"fs-extra","optional":false},{"reason":"peer dependency for glob pattern matching","package":"globby","optional":false}],"imports":[{"note":"The package provides a default ESM export. CommonJS require will not work without .default.","wrong":"const copy = require('rollup-plugin-copy-merge')","symbol":"default","correct":"import copy from 'rollup-plugin-copy-merge'"},{"note":"RollupOptions is not exported by this plugin; import from 'rollup'.","wrong":"import { RollupOptions } from 'rollup-plugin-copy-merge'","symbol":"RollupOptions","correct":"import type { RollupOptions } from 'rollup'"},{"note":"TypeScript types are bundled; CopyOptions interface is exported for configuration.","wrong":"","symbol":"CopyOptions","correct":"import type { CopyOptions } from 'rollup-plugin-copy-merge'"}],"quickstart":{"code":"// rollup.config.js\nimport copy from 'rollup-plugin-copy-merge'\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    file: 'dist/app.js',\n    format: 'cjs'\n  },\n  plugins: [\n    copy({\n      targets: [\n        { src: 'src/index.html', dest: 'dist/public' },\n        { src: 'assets/js/*.js', file: 'dist/public/scripts.js' },\n        { src: 'assets/images/**/*', dest: 'dist/public/images' }\n      ]\n    })\n  ]\n}","lang":"typescript","description":"Shows basic plugin usage in rollup.config.js, including copying single files, merging globs into a single file, and using glob patterns."},"warnings":[{"fix":"Update Rollup to v2+ or use an older version of the plugin.","message":"Plugin requires Rollup 2.x or later","severity":"breaking","affected_versions":"<2.0.0"},{"fix":"Use 'file' only for text files; for binary assets, use 'dest' instead.","message":"The 'file' target property only works for UTF-8 encoded files. Binary files merged into one will produce corrupt output.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Set flatten: true (default) to ignore src directory structure.","message":"When using flatten: false, the directory structure from src is preserved in dest. This may cause unintended nested directories.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Provide a function as rename: (name, ext, srcPath) => ...","message":"The 'rename' option as a string renames only the last part of the path; for full control use a function.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Ensure Node >=14 as specified in engine requirement.","message":"Globby ^11.1.0 requires Node >=10; older Node versions may fail.","severity":"breaking","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.3':31 '14':56 'add':18 'allow':36 'asset':79,80 'capabl':21 'colorett':68 'copi':4,10,28,77 'cp':78 'current':29 'depend':71 'destin':44 'differenti':35 'extra':65 'file':11,19,40,45,48,81,82 'folder':13 'fs':64 'fs-extra':63 'glob':15 'globbi':66 'javascript':72 'key':34 'maintain':33 'merg':5,20,37 'multipl':38 'node':55 'peer':70 'plugin':3,8,27,76 'predecessor':53 'properti':50 'reli':61 'requir':54 'rollup':2,7,26,73,75 'rollup-plugin':74 'rollup-plugin-copi':25 'rollup-plugin-copy-merg':1 'ship':57 'singl':43 'sourc':39 'stabl':32 'support':16 'target':49 'top':23 'type':59 'typescript':58,83 'unlik':51 'version':30 'via':46","created_at":"2026-04-27T17:02:41.178704+00:00","updated_at":"2026-04-27T17:02:41.178704+00:00","problems":[{"fix":"Run: npm install rollup-plugin-copy-merge --save-dev","cause":"Package not installed or missing from node_modules.","error":"Error: Cannot find module 'rollup-plugin-copy-merge'"},{"fix":"Change to: const copy = require('rollup-plugin-copy-merge').default","cause":"Using CommonJS require without .default.","error":"TypeError: copy is not a function"},{"fix":"Check src paths and ensure files exist; use absolute paths or adjust relative to project root.","cause":"Source path does not exist or glob matches nothing.","error":"Error: ENOENT: no such file or directory, copyfile '...' -> '...'"}],"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/syJSdev/rollup-plugin-copy-merge","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/rollup-plugin-copy-merge","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}}