Repository navigation
refactor(precompile): minify with webpack's SourceProcessor where webpack has one - #241
Conversation
…pack has one webpack's `javascript.syntax.printer.load()` is an experimental shim over the one `SourceProcessor` minify pass and is going away; webpack 5.112.x, which has no `SourceProcessor`, still minifies through it. Claude-Session: https://claude.ai/code/session_01Tgxgyb4N35ndP6cC4KcrXC
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #241 +/- ##
==========================================
+ Coverage 97.22% 97.23% +0.01%
==========================================
Files 13 13
Lines 1224 1231 +7
Branches 473 477 +4
==========================================
+ Hits 1190 1197 +7
Misses 32 32
Partials 2 2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
No actionable comments were generated in the recent review.
|
Ports dependabot's #240 so the Lint job's `npm audit` passes. Claude-Session: https://claude.ai/code/session_01Tgxgyb4N35ndP6cC4KcrXC
Summary
precompile --minifycallswebpack.javascript.syntax.printer.load(), an experimental shim webpack keeps only for this. webpack minifies JavaScript in oneSourceProcessorrun now and is going to removeload(). This PR usesSourceProcessorwhen webpack exports it, and falls back toload()only for webpack 5.112.x, which has noSourceProcessor.Checked end to end against webpack
main: a CommonJS and an ES module check both minify (1779 B and 1778 B), and the minified check accepts and rejects the same values as before.What kind of change does this PR introduce?
refactor
Did you add tests for your changes?
Yes,
test/precompile.test.js: theSourceProcessorpath with the options it receives. The existing minify tests cover theload()fallback with the installed webpack 5.112.0.Does this PR introduce a breaking change?
No. webpack 5.112.0 or later is still enough.
If relevant, what needs to be documented once your changes are merged or what have you already documented?
n/a
Use of AI
Claude Code wrote the change and the test and ran them against the installed webpack and webpack
main. A maintainer directed the work and reviews it.Generated by Claude Code
Summary by CodeRabbit