An esbuild plugin (v0.1.0, stable) to copy static files from a source to destination directory only when files have changed (by MD5 hash). No third-party dependencies, purely uses Node.js standard library. Primarily designed to avoid unnecessary file copies during development with live-reloading tools. Differs from alternatives like `esbuild-plugin-copy` by focusing on change detection and minimal configuration.
npm install esbuild-copy-static-filesVerified import paths — ran on the pinned version, not inferred.
Configures esbuild with the plugin to copy static files from './static' to './out', skipping '.bak' files.
Use Node.js 16.7.0 or higher. Check your Node version with `node --version`.
If you have many static files, consider alternative async plugins like `esbuild-plugin-copy`.
Use path.basename or path.relative for filtering instead of simple string checks.
Set `force: true` or `errorOnExist: false` explicitly to avoid errors.
Use `const copyStaticFiles = require('esbuild-copy-static-files')` or `import copyStaticFiles from 'esbuild-copy-static-files'`.Ensure `src` path exists relative to the build script. Use absolute paths or verify directory structure.
Update `filter` to exclude FIFO/pipe files: `filter: (src) => !fs.statSync(src).isFIFO()`