A simplified alternative to copy-webpack-plugin for copying files and directories during webpack builds. Current stable version is 6.0.0, released with node >=24 and webpack ^5.105.0 peer dependencies. Key differentiators: vastly simplified API (single string for a glob pattern, no nested `patterns` array), minimal configuration, and ESM-only exports. Replaces the verbose copy-webpack-plugin with a concise one-liner for common use cases, while still supporting advanced options via an array of objects. Active development under the best-shot organization.
npm install copy-webpackVerified import paths — ran on the pinned version, not inferred.
Shows minimal usage: copy all files from 'static' directory into the webpack output.
Upgrade Node.js to >=24 and pnpm to >=10 (or use an alternative package).
Use the simplified `new CopyWebpack(from)` or `new CopyWebpack([...])` API.
Use dynamic import: `const { CopyWebpack } = await import('copy-webpack')`.Test with a sample file to ensure the glob pattern matches expected files.
Correct import: import { CopyWebpack } from 'copy-webpack'Run 'npm install copy-webpack webpack --save-dev'
Only import from 'copy-webpack' directly; no subpath imports are supported.