Registry / devops / esbuild-plugin-copy

esbuild-plugin-copy

JSON →
library2.1.1jsnpmunverified

ESBuild plugin for copying assets during builds. Current stable version 2.1.1, released under the LinbuduLab organization. Supports glob patterns, keeps file structure, has watching mode based on chokidar polling, and allows flexible destination configuration. Differentiates from simple shell commands by integrating directly into ESBuild's plugin lifecycle, offering verbose logging, and the ability to copy only on asset changes.

npm install esbuild-plugin-copy
INSTALL
IMPORT
SIG · ESBUILD-PLUGIN-COP
E
esbuild-plugin-copy
devopsjavascriptv2.1.1
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.

copy
import { copy } from 'esbuild-plugin-copy'
import copy from 'esbuild-plugin-copy'
The plugin exports a named function, not a default export.

Shows basic usage of the copy plugin with ESBuild, including watch mode and asset copy from ./assets to output directory.

import { build } from 'esbuild'; import { copy } from 'esbuild-plugin-copy'; (async () => { const res = await build({ entryPoints: ['./src/main.ts'], bundle: true, watch: true, outfile: './dist/main.js', plugins: [ copy({ resolveFrom: 'cwd', assets: { from: ['./assets/*'], to: ['./assets'], }, watch: true, }), ], }); })();
Debug
Known issues
gotchaGlob pattern 'dir/*' does not expand directories; use 'dir/**/*' to include nested files.
fix
Use 'from: ['./dir/**/*']' to match all files recursively.
affects: >=1.0.0
gotchaWatching mode requires ESBuild's watch option to be enabled and only works for files outside absWorkingDir.
fix
Set 'watch: true' in both ESBuild build options and plugin options. Ensure watched files are not inside absWorkingDir.
affects: >=1.0.0
deprecatedThe 'resolveFrom' option may change behavior in future versions; rely on ESBuild's outdir/outfile by default.
fix
Omit 'resolveFrom' to use ESBuild output directory as base path.
affects: >=2.0.0
Errors
Common errors & fixes
No files matched using current glob pattern: ./node_modules/tinymce/skins/*
Using 'dir/*' when there are no direct files in that directory, only subdirectories.
fix
Change glob pattern to './node_modules/tinymce/skins/**/*' to include files in subdirectories.
Upgrade
Version history
2.1.1latest on npm
Audit
Dependencies
esbuildrequiredpeer dependency required
Agent activity
4 hits · last 30 days
node
4
Resources
esbuild-plugin-copy — npm install esbuild-plugin-copy · libregistry