This repository was archived by the owner on Sep 7, 2026. It is now read-only.
feat: deprecate in favor of webpack's output.copy - #839
Merged
Conversation
webpack copies files itself since 5.111.0. Warns once per process when the compiler running the plugin has 'webpack.CopyPlugin', so a webpack with nothing to migrate to stays quiet, and documents what each option becomes.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #839 +/- ##
==========================================
+ Coverage 92.00% 92.21% +0.20%
==========================================
Files 2 2
Lines 413 424 +11
Branches 124 126 +2
==========================================
+ Hits 380 391 +11
Misses 32 32
Partials 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Clears four high-severity advisories covering 3.0.0-3.1.5, which turned the lint job's 'npm audit --production' red on every branch once they were published. Transitive through ajv, so only the lockfile moves.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
webpack copies files itself since 5.111.0 (webpack/webpack#21938), through
output.copyand thewebpack.CopyPluginbehind it, so this package is no longer needed there. Adds a one-timeDeprecationWarningand a README section saying what each option becomes, linking the worked example in webpack'sexamples/output-copy.The warning is a capability check, not a version comparison: it fires only when the compiler's
compiler.webpackhasCopyPlugin, so anyone on an older webpack — where this plugin is still the answer — sees nothing.What kind of change does this PR introduce?
feat
Did you add tests for your changes?
Yes —
test/deprecation.test.jscovers the warning's message, type and code, that it fires once across several compilers, and that it stays silent both when webpack cannot copy files itself and when there is nocompiler.webpackat all.Does this PR introduce a breaking change?
No. The package keeps working unchanged; only a Node deprecation warning is added, which
--no-deprecationsilences like any other.If relevant, what needs to be documented once your changes are merged or what have you already documented?
The README carries the deprecation notice, the migration diff and the option-by-option table. If the package is later marked deprecated on npm, the same text fits.
Use of AI
Claude Code wrote the deprecation warning, the tests and the README section, and verified them:
lint:prettier,lint:code,lint:spellingandlint:typesall pass, and the full suite is green (15 suites, 264 tests). It also checked the migration table against both option schemas rather than from memory, and corrected one claim it had got wrong — a lateprocessAssetsstagedoes not keep a copied file out of the minimizer, because the minimizer taps withadditionalAssets: trueand so re-runs for assets added later;info: { minimized: true }is what does.Generated by Claude Code