Skip to content

feat: support webpack processContent hook for CSS embedded in JS#311

Draft
xiaoxiaojx wants to merge 3 commits intowebpack:mainfrom
xiaoxiaojx:feat/process-content-hook
Draft

feat: support webpack processContent hook for CSS embedded in JS#311
xiaoxiaojx wants to merge 3 commits intowebpack:mainfrom
xiaoxiaojx:feat/process-content-hook

Conversation

@xiaoxiaojx
Copy link
Copy Markdown
Member

@xiaoxiaojx xiaoxiaojx commented Mar 31, 2026

Summary
webpack/webpack#20736

What kind of change does this PR introduce?
feat

Did you add tests for your changes?
Yes

Does this PR introduce a breaking change?
No

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

@xiaoxiaojx xiaoxiaojx marked this pull request as draft March 31, 2026 16:31
- Add `compilation.hooks.processContent` support to minimize CSS content
  embedded in JS bundles (text/style/css-style-sheet export types)
- Extract `transformSource` method to share minification logic, error
  handling, source map validation, and warning filtering between
  processAssets and processContent paths
- Extract `createWorkerFactory` for reusable lazy worker pool management
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

❌ Patch coverage is 97.16981% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.92%. Comparing base (e9ee2d2) to head (5d2d9c9).

Files with missing lines Patch % Lines
src/index.js 97.16% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #311      +/-   ##
==========================================
- Coverage   97.29%   96.92%   -0.38%     
==========================================
  Files           3        3              
  Lines         296      325      +29     
  Branches      117      125       +8     
==========================================
+ Hits          288      315      +27     
- Misses          8       10       +2     

☔ 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.

@xiaoxiaojx xiaoxiaojx force-pushed the feat/process-content-hook branch from 5679019 to 8e19cbf Compare March 31, 2026 16:33
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.

1 participant