An esbuild plugin to efficiently copy static files from a source directory to a destination directory
npm install @sprout2000/esbuild-copy-pluginAn esbuild plugin to efficiently copy static files from a source directory to a destination directory.
_\* This plugin is a typed and fully tested version of @nickjj's esbuild-copy-static-files._
``sh`
npm install --save-dev @sprout2000/esbuild-copy-plugin
_You will need to have Node.js >=16.7 installed._
`js
import { build } from "esbuild";
import { copyPlugin } from "@sprout2000/esbuild-copy-plugin";
build({
plugins: [
copyPlugin({
src: "./assets/icon.png",
dest: "./dist/logo.png",
}),
],
});
`
`typescript`
interface CopyPluginOptions extends fs.CopySyncOptions {
src?: string;
dest?: string;
}
| option | default |
| :------------------------------------ | :---------- |
| src?: string | "assets" |dest?
| : string | "dist" |dereference?
| : boolean | false |errorOnExist?
| : boolean | false |filter?
| : (src, dest) => boolean | undefined |force?
| : boolean | false |preserveTimestamps?
| : boolean | false |recursive?
| : boolean | true |verbatimSymlinks?
| : boolean | false |
_See fs.CopySyncOptions in Node.js LTS for more details._
`shclone this repo, and install devDependencies...
git clone https://github.com/sprout2000/esbuild-copy-plugin.git
cd esbuild-copy-plugin
npm install