An esbuild plugin to copy files and directories during builds. Current stable version is 1.0.0. The plugin is updated irregularly. Key differentiators: simple API with source/target arrays, copyWithFolder option to preserve or flatten directory structure, minimal dependencies. Suitable for copying static assets like HTML, images, or fonts alongside esbuild bundles.
npm install esbuild-copy-files-pluginNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to configure the plugin with CJS in esbuild to copy HTML and images preserving folder structure.
Ensure source array has at least one path.
Use copyWithFolder: true or ensure unique filenames.
Manually list specific directories or files if full depth is undesirable.
Update both packages: npm install esbuild@latest esbuild-copy-files-plugin@latest
Use: import { copy } from 'esbuild-copy-files-plugin' or const { copy } = require('esbuild-copy-files-plugin')Verify source paths and ensure they exist relative to process.cwd()