Skip to content

feat: add support for plugin usage with dedicated wrappers and logging#2272

Merged
alexander-akait merged 15 commits intonextfrom
plugin_support
Mar 11, 2026
Merged

feat: add support for plugin usage with dedicated wrappers and logging#2272
alexander-akait merged 15 commits intonextfrom
plugin_support

Conversation

@bjohansebas
Copy link
Member

@bjohansebas bjohansebas commented Mar 1, 2026

Summary

fixes #979

I still need to add tests. This is so that when webpack-dev-server is used as a plugin, we don’t flood the logs and it respects the webpack logger option.

What kind of change does this PR introduce?

Did you add tests for your changes?

Does this PR introduce a breaking change?

If relevant, what needs to be documented once your changes are merged or what have you already documented?

Use of AI

@codecov
Copy link

codecov bot commented Mar 1, 2026

Codecov Report

❌ Patch coverage is 95.71429% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.97%. Comparing base (df7ddb4) to head (353e92e).
⚠️ Report is 1 commits behind head on next.

Files with missing lines Patch % Lines
src/utils/setupHooks.js 93.33% 2 Missing ⚠️
src/index.js 97.43% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             next    #2272      +/-   ##
==========================================
+ Coverage   96.92%   96.97%   +0.04%     
==========================================
  Files          13       13              
  Lines         911      926      +15     
  Branches      266      271       +5     
==========================================
+ Hits          883      898      +15     
  Misses         28       28              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bjohansebas bjohansebas marked this pull request as ready for review March 6, 2026 20:15
@alexander-akait
Copy link
Member

@bjohansebas I fixed the logic, WIP on tests, the main idea of a plugin support is using this code inside plugin, i.e. when you run

const webpack = webpack.watch((err, stats) => {
  if (err) {
    throw err;
  }
  
  console.log(stats.toString());
})

callback will call on the each compilation and so stats will be outputed by callback in webpack-cli (or custom code), so it will also allow to run multiple instanced without extra output and weird logic around multi compilers

@alexander-akait
Copy link
Member

I think we can avoid extra wrappers in favor the inPlugin option, will finish soon

@alexander-akait alexander-akait merged commit a34b3ee into next Mar 11, 2026
13 of 14 checks passed
@alexander-akait alexander-akait deleted the plugin_support branch March 11, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants