Registry / devops / rollup-plugin-copier

rollup-plugin-copier

JSON →
library1.1.0jsnpmunverified

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.

npm install rollup-plugin-copier
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-COPI
R
rollup-plugin-copier
devopsjavascriptv1.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import copier from 'rollup-plugin-copier'
const copier = require('rollup-plugin-copier')
ESM-only; CJS require will not work unless the package is transpiled.
copier
import copier from 'rollup-plugin-copier'
import { copier } from 'rollup-plugin-copier'
Named import is incorrect; the plugin exports a default function.
type
import type { RollupPluginCopierOptions } from 'rollup-plugin-copier'
import { RollupPluginCopierOptions } from 'rollup-plugin-copier'
Options type can be imported for TypeScript usage, but only as type import.

Configures rollup-plugin-copier to copy a single file and a glob pattern, with path creation enabled.

// rollup.config.js import copier from 'rollup-plugin-copier'; export default { input: 'src/index.js', output: { dir: 'dist', format: 'esm' }, plugins: [ copier({ items: [ { src: 'public/robots.txt', dest: 'dist/robots.txt' }, { src: 'assets/*', dest: 'dist/assets', createPath: true } ], verbose: true }) ] };
Debug
Known issues
gotchaThe 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.
fix
Ensure the plugin runs after all transformations; consider using buildStart or writeBundle if needed.
affects: >=1.0.0
deprecatedOption 'hookOn' is deprecated and will be removed in a future major version.
fix
Stop using hookOn; the plugin will use a fixed hook in the next major.
affects: >=1.1.0
gotchaGlob patterns in 'src' are not expanded; only exact file paths or directories work. Use a separate glob plugin if needed.
fix
Use rollup-plugin-copy-glob or pre-expand globs before passing to copier.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Could not resolve 'rollup-plugin-copier'
The package is not installed or not in node_modules.
fix
Run 'npm install rollup-plugin-copier' or 'yarn add rollup-plugin-copier'.
TypeError: copier is not a function
Using a named import instead of default import.
fix
Change to 'import copier from 'rollup-plugin-copier''
Error: ENOENT: no such file or directory, copyfile '...' -> '...'
Source file does not exist or destination directory missing and createPath not set.
fix
Check source path exists; set createPath: true for destination directories.
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Resources
rollup-plugin-copier — npm install rollup-plugin-copier · libregistry