{"id":21897,"library":"rollup-copy-plugin","title":"rollup-copy-plugin","description":"A simple Rollup plugin that copies files from source to destination during the build process. Version 0.1.0 is the initial and only release. It copies files once when Rollup starts; subsequent changes are not watched. This is a minimal plugin for static file copying, in contrast to more feature-rich alternatives like rollup-plugin-copy that support glob patterns and watch mode. It is designed for simple use cases where files need to be placed in the output directory without transformation.","status":"maintenance","version":"0.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/eritikass/rollup-copy-plugin","tags":["javascript"],"install":[{"cmd":"npm install rollup-copy-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-copy-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-copy-plugin","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package provides a default export; CommonJS require works but is less common in Rollup setups.","wrong":"const copyPlugin = require('rollup-copy-plugin')","symbol":"default","correct":"import copyPlugin from 'rollup-copy-plugin'"},{"note":"CommonJS require pattern works with this package; the default export is a function.","symbol":"default","correct":"const copyPlugin = require('rollup-copy-plugin')"},{"note":"The imported value is used as a function call in the Rollup plugins array.","symbol":"copyPlugin","correct":"import copyPlugin from 'rollup-copy-plugin'"}],"quickstart":{"code":"// rollup.config.js\nimport copyPlugin from 'rollup-copy-plugin'\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    dir: 'dist',\n    format: 'es'\n  },\n  plugins: [\n    copyPlugin({\n      './src/static/data.json': './dist/data.json',\n      './src/assets/logo.png': './dist/assets/logo.png'\n    })\n  ]\n}","lang":"javascript","description":"Rollup configuration using rollup-copy-plugin to copy two files from src to dist."},"warnings":[{"fix":"Restart Rollup to re-copy files, or use a plugin with watch mode like rollup-plugin-copy.","message":"Files are copied only once when Rollup starts. Changes made after initial build are not reflected unless Rollup is restarted.","severity":"gotcha","affected_versions":"<=0.1.0"},{"fix":"Use explicit file paths or switch to rollup-plugin-copy for glob support.","message":"The plugin does not support glob patterns; paths must be explicit.","severity":"gotcha","affected_versions":"<=0.1.0"},{"fix":"Ensure output directories exist or use a plugin that creates directories automatically.","message":"If the output directory does not exist, the plugin may fail silently depending on the environment.","severity":"gotcha","affected_versions":"<=0.1.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run 'npm install rollup-copy-plugin --save-dev'","cause":"Package is not installed.","error":"Error: Cannot find module 'rollup-copy-plugin'"},{"fix":"Use 'import copyPlugin from 'rollup-copy-plugin''","cause":"Incorrect import (e.g., named import instead of default).","error":"TypeError: copyPlugin is not a function"},{"fix":"Check that the source path is correct relative to the Rollup config file's working directory.","cause":"Source file does not exist or path is incorrect.","error":"Error: ENOENT: no such file or directory, copyfile '/src/test1.txt' -> '/dist/test1.txt'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}