Repository navigation
fix(webpack): allow emitting assets from buildEnd - #619
Huzaifa-Asif wants to merge 1 commit into
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughWebpack runs ChangesWebpack buildEnd asset emission
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Low Sequence Diagram(s)sequenceDiagram
participant WebpackCompiler
participant Compilation
participant UnpluginBuildEnd
participant Output
WebpackCompiler->>Compilation: Start thisCompilation
Compilation->>UnpluginBuildEnd: Run buildEnd at PROCESS_ASSETS_STAGE_ADDITIONAL
UnpluginBuildEnd->>Compilation: Emit build-end.json
WebpackCompiler->>Output: Write emitted asset
Merge Risk: ⚪ Minimal · up to No actionable merge-blocking risk remains for the Webpack buildEnd change after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change preserves existing plugin authority and keeps asset emission under Webpack’s control. Successful execution is covered by a regression test, but failure after asset creation and repeated or interrupted builds remain unverified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
buildEndhooks duringprocessAssetsat the additional-assets stageemit-hook behavior as a compatibility fallback for older webpack versionsbuildEndruns before webpack begins emitting and thatthis.emitFilewrites the requested assetWebpack currently invokes
buildEndfromcompiler.hooks.emit, after compilation assets have been sealed. Callingthis.emitFilethere triggers webpack'sDEP_WEBPACK_COMPILATION_ASSETSwarning and is incompatible with webpack's asset lifecycle. Moving the hook intoprocessAssetslets emitted assets participate in the rest of webpack's asset pipeline.Resolves #473.
Verification
pnpm exec vitest run test/unit-tests/build-end/build-end.test.ts— 1 passed (the regression fails onmainbecausebuildEndruns afteremitbegins)pnpm test— 24 files passed, 3 skipped; 167 tests passed, 25 skippedpnpm lintpnpm typecheckpnpm buildgit diff --checkAI assistance
OpenAI Codex assisted with issue research, implementation, tests, verification, and drafting this description. The contributor reviewed the submitted code and tests on 2026-10-04, after the draft PR had been opened.