{"id":25272,"library":"esbuild-copy-plugin","title":"esbuild-copy-plugin","description":"A plugin for esbuild that copies files or directories from one location to another during the build process. Version 1.0.0 is the current release. It provides a simple API to define copy operations using `from` and `to` paths. Unlike general-purpose tools like `cpy` or `copy-webpack-plugin`, this is tightly integrated with esbuild's plugin system and runs as part of the build lifecycle. The package is lightweight, with no dependencies. It is maintained, but has a low release cadence.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/DasRed/esbuild-plugin-copy","tags":["javascript","esbuild","plugin","copy"],"install":[{"cmd":"npm install esbuild-copy-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-copy-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-copy-plugin","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package exports a single default function that returns an esbuild plugin.","symbol":"default","correct":"import copy from 'esbuild-copy-plugin'"},{"note":"Requiring with destructuring fails because the module exports a default, not named exports.","wrong":"const { copy } = require('esbuild-copy-plugin')","symbol":"default","correct":"const copy = require('esbuild-copy-plugin')"}],"quickstart":{"code":"import esbuild from 'esbuild';\nimport copy from 'esbuild-copy-plugin';\n\nawait esbuild.build({\n    entryPoints: ['./src/index.js'],\n    bundle: true,\n    outfile: './dist/index.js',\n    plugins: [\n        copy({ from: './public', to: '.' }),\n    ],\n});","lang":"javascript","description":"Basic usage: copies all files from ./public to ./dist (the output directory) during the esbuild build."},"warnings":[{"fix":"Use absolute paths or ensure your working directory is the project root.","message":"The `from` path is relative to the current working directory, not the esbuild build's root.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Specify 'to' relative to outdir, e.g., if outdir is './dist', to: '.' places files directly in './dist'.","message":"The `to` path is relative to the output directory (outfile/outdir's parent by default).","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"N/A","message":"No known deprecations.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.0':24 'anoth':18 'api':33 'build':21,70 'cadenc':87 'copi':3,10,36,52,91 'copy-webpack-plugin':51 'cpi':49 'current':27 'defin':35 'depend':78 'directori':13 'esbuild':2,8,60,89 'esbuild-copy-plugin':1 'file':11 'general':45 'general-purpos':44 'integr':58 'javascript':88 'lifecycl':71 'lightweight':75 'like':48 'locat':16 'low':85 'maintain':81 'one':15 'oper':37 'packag':73 'part':67 'path':42 'plugin':4,6,54,62,90 'process':22 'provid':30 'purpos':46 'releas':28,86 'run':65 'simpl':32 'system':63 'tight':57 'tool':47 'unlik':43 'use':38 'version':23 'webpack':53","created_at":"2026-05-01T13:43:55.032361+00:00","updated_at":"2026-05-01T13:43:55.032361+00:00","problems":[{"fix":"Make sure esbuild build is awaited (since esbuild 0.17+ build returns a promise).","cause":"The copy operation completed after esbuild finished because it's asynchronous but not awaited.","error":"Error: The plugin \"copy\" returned a copy result but the build finished."},{"fix":"Use `import copy from 'esbuild-copy-plugin'` or `const copy = require('esbuild-copy-plugin')`.","cause":"Using `import { copy } from 'esbuild-copy-plugin'` instead of default import.","error":"TypeError: copy is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/DasRed/esbuild-plugin-copy","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/esbuild-copy-plugin","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}