Registry / devops / rollup-copy-plugin

rollup-copy-plugin

JSON →
library0.1.0jsnpmunverified

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.

npm install rollup-copy-plugin
INSTALL
IMPORT
SIG · ROLLUP-COPY-PLUGIN
R
rollup-copy-plugin
devopsjavascriptv0.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 copyPlugin from 'rollup-copy-plugin'
const copyPlugin = require('rollup-copy-plugin')
The package provides a default export; CommonJS require works but is less common in Rollup setups.
default
const copyPlugin = require('rollup-copy-plugin')
CommonJS require pattern works with this package; the default export is a function.
copyPlugin
import copyPlugin from 'rollup-copy-plugin'
The imported value is used as a function call in the Rollup plugins array.

Rollup configuration using rollup-copy-plugin to copy two files from src to dist.

// rollup.config.js import copyPlugin from 'rollup-copy-plugin' export default { input: 'src/index.js', output: { dir: 'dist', format: 'es' }, plugins: [ copyPlugin({ './src/static/data.json': './dist/data.json', './src/assets/logo.png': './dist/assets/logo.png' }) ] }
Debug
Known issues
gotchaFiles are copied only once when Rollup starts. Changes made after initial build are not reflected unless Rollup is restarted.
fix
Restart Rollup to re-copy files, or use a plugin with watch mode like rollup-plugin-copy.
affects: <=0.1.0
gotchaThe plugin does not support glob patterns; paths must be explicit.
fix
Use explicit file paths or switch to rollup-plugin-copy for glob support.
affects: <=0.1.0
gotchaIf the output directory does not exist, the plugin may fail silently depending on the environment.
fix
Ensure output directories exist or use a plugin that creates directories automatically.
affects: <=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'rollup-copy-plugin'
Package is not installed.
fix
Run 'npm install rollup-copy-plugin --save-dev'
TypeError: copyPlugin is not a function
Incorrect import (e.g., named import instead of default).
fix
Use 'import copyPlugin from 'rollup-copy-plugin''
Error: ENOENT: no such file or directory, copyfile '/src/test1.txt' -> '/dist/test1.txt'
Source file does not exist or path is incorrect.
fix
Check that the source path is correct relative to the Rollup config file's working directory.
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
8
Resources
rollup-copy-plugin — npm install rollup-copy-plugin · libregistry