Skip to content

fix(webpack): emit assets during processAssets on webpack 5 - #99

Draft
GreatAuk wants to merge 1 commit into
mainfrom
fix/98-webpack-process-assets
Draft

GreatAuk wants to merge 1 commit into
mainfrom
fix/98-webpack-process-assets

Conversation

@GreatAuk

@GreatAuk GreatAuk commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

Fixes #98.

Webpack 5 warns because the plugin adds version JSON, notification CSS and JS to Compilation.assets from emit, after asset processing has finished. Register asset generation on thisCompilation / processAssets at PROCESS_ASSETS_STAGE_ADDITIONAL and emit RawSource assets through the compiler's webpack instance. Keep webpack 4's existing emit path, and preserve the existing afterEmit HTML injection.

Use the compiler's webpack version to select the path rather than checking emitAsset, which later webpack 4 releases also provide.

Validation:

  • All six workspace packages build successfully.
  • Four integration tests pass with real webpack 4.47.0 and 5.101.0 under --trace-deprecation, covering default/hidden notifications and two compilations on each compiler. Assert version JSON, silence, hashed CSS/JS, public-path HTML references, notification anchor, and webpack 5 byte sizes for Unicode content.
  • The same integration suite against the unchanged main plugin reproduces DEP_WEBPACK_COMPILATION_ASSETS and fails; the fixed plugin passes without that warning.
  • Lint passes with one pre-existing warning in core; changed-file formatting and webpack source typecheck pass.
  • Root tsc --noEmit fails on existing example configuration/JSX/Vite type errors. Its output is byte-for-byte identical with the unchanged main plugin source.
  • Existing Vitest unit command exits with no test files (examples are excluded). Browser E2E was not run for this compiler-only change.

Add pnpm test:webpack and a focused CI job. The focused install skips lifecycle scripts because the Nuxt example's postinstall requires workspace packages before they are built; the existing repository CI is otherwise unchanged.

CI results for 902a1e1b277f0414c8f52ccc1b5c5d5d60e25944 (all checks reached terminal state):

  • Webpack compatibility: passed, including all four real compiler tests.
  • Existing CI: all five jobs fail at Install, before lint/typecheck/build/test, because the Nuxt example postinstall cannot load the unbuilt local Nuxt package. The latest main CI fails with the same message in all five jobs. This pre-existing repository-wide lifecycle failure is outside the webpack asset fix.

@coderabbitai

coderabbitai Bot commented Oct 8, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant