{"id":21962,"library":"rollup-plugin-copier","title":"rollup-plugin-copier","description":"A Rollup plugin to copy files or directories during the build process. Version 1.1.0, released under ISC license. It supports configurable hook execution (default buildEnd), optional path creation, and verbose logging. Differentiated from alternatives like rollup-plugin-copy by being actively maintained and simpler in configuration.","status":"active","version":"1.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/marverix/rollup-plugin-copier","tags":["javascript","rollup","plugin","rollup-plugin","copy","assets","copier","rollup-plugin-copier","rollup-plugin-copy"],"install":[{"cmd":"npm install rollup-plugin-copier","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-copier","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-copier","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only; CJS require will not work unless the package is transpiled.","wrong":"const copier = require('rollup-plugin-copier')","symbol":"default","correct":"import copier from 'rollup-plugin-copier'"},{"note":"Named import is incorrect; the plugin exports a default function.","wrong":"import { copier } from 'rollup-plugin-copier'","symbol":"copier","correct":"import copier from 'rollup-plugin-copier'"},{"note":"Options type can be imported for TypeScript usage, but only as type import.","wrong":"import { RollupPluginCopierOptions } from 'rollup-plugin-copier'","symbol":"type","correct":"import type { RollupPluginCopierOptions } from 'rollup-plugin-copier'"}],"quickstart":{"code":"// rollup.config.js\nimport copier from 'rollup-plugin-copier';\n\nexport default {\n  input: 'src/index.js',\n  output: { dir: 'dist', format: 'esm' },\n  plugins: [\n    copier({\n      items: [\n        { src: 'public/robots.txt', dest: 'dist/robots.txt' },\n        { src: 'assets/*', dest: 'dist/assets', createPath: true }\n      ],\n      verbose: true\n    })\n  ]\n};","lang":"typescript","description":"Configures rollup-plugin-copier to copy a single file and a glob pattern, with path creation enabled."},"warnings":[{"fix":"Ensure the plugin runs after all transformations; consider using buildStart or writeBundle if needed.","message":"The plugin copies files only once during the specified hook (default buildEnd). Changes to source files after that hook will not be reflected in the output.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Stop using hookOn; the plugin will use a fixed hook in the next major.","message":"Option 'hookOn' is deprecated and will be removed in a future major version.","severity":"deprecated","affected_versions":">=1.1.0"},{"fix":"Use rollup-plugin-copy-glob or pre-expand globs before passing to copier.","message":"Glob patterns in 'src' are not expanded; only exact file paths or directories work. Use a separate glob plugin if needed.","severity":"gotcha","affected_versions":">=1.0.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-plugin-copier' or 'yarn add rollup-plugin-copier'.","cause":"The package is not installed or not in node_modules.","error":"Error: Could not resolve 'rollup-plugin-copier'"},{"fix":"Change to 'import copier from 'rollup-plugin-copier''","cause":"Using a named import instead of default import.","error":"TypeError: copier is not a function"},{"fix":"Check source path exists; set createPath: true for destination directories.","cause":"Source file does not exist or destination directory missing and createPath not set.","error":"Error: ENOENT: no such file or directory, copyfile '...' -> '...'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}