Skip to content

docs: clarify buildEnd timing in Vite dev and webpack watch mode - #642

Open
Sion612 wants to merge 1 commit into
unjs:mainfrom
Sion612:docs/buildend-timing-569
Open

Sion612 wants to merge 1 commit into
unjs:mainfrom
Sion612:docs/buildend-timing-569

Conversation

@Sion612

@Sion612 Sion612 commented Nov 13, 2026 •

Copy link
Copy Markdown

resolves #569

The Supported Hooks table lists buildEnd for both Vite and webpack, but the hook runs at different points in their development lifecycles.

This PR adds a short note to clarify the difference: in Vite dev mode, buildEnd runs when the development server closes, while in webpack it runs during compilation, including rebuilds in watch mode. It also links to the Bundler-Specific Logic section for plugins that need to handle these differences.

This is a documentation-only change with no runtime modifications.

Verification

  • Vite 8.3.5: Verified locally in middleware mode — buildEnd was not called after module transforms and ran once when server.close() was called.
  • webpack 5.112.2: Verified locally with compiler.watch() — buildEnd ran once on the initial compilation and once on rebuild, with no additional calls when closing the watcher and compiler.
  • Checks: On November 11, Markdown ESLint, pnpm typecheck, pnpm build, and pnpm test:unit (273 passed, 62 skipped) passed on this patch at 5daf6e6. On November 13, the patch applied cleanly to the same base and git diff --check passed. The full test suite and documentation site build were not run locally.

Summary by CodeRabbit

  • Documentation
    • Clarified when buildEnd runs during Vite and webpack builds, including watch-mode rebuilds.
    • Added guidance for handling cleanup tied to a specific bundler lifecycle.

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Supported Hooks documentation now describes when buildEnd runs in Vite and webpack. It links to Bundler-Specific Logic for cleanup tied to a bundler lifecycle.

Changes: Hook lifecycle documentation

Layer / File(s) Summary
Document buildEnd timing
docs/guide/index.md
The documentation describes buildEnd timing in Vite dev mode and webpack, including watch-mode rebuilds. It links to Bundler-Specific Logic for bundler-specific cleanup.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Suggested reviewers: sxzz

Merge Risk: Minimal · up to d19c6

This documentation-only change clarifies when buildEnd runs in Vite and webpack. It has no runtime impact and is ready to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: clarifying in the docs when buildEnd runs in Vite dev servers and webpack watch mode. The raw summary and PR objectives both describe a documentation-only change that …
Linked Issues check Passed Issue #569 asks whether the different buildEnd timing in Vite and webpack should be handled with new hooks or documented. It sets no formal acceptance criteria. The PR chooses documentation. At the …
Out of Scope Changes check Passed The PR changes only the Supported Hooks documentation in docs/guide/index.md, with four added lines per the supplied summary. The added note states the buildEnd timing difference that #569 describes…
Full details: Title check

Explanation

The title names the main change: clarifying in the docs when buildEnd runs in Vite dev servers and webpack watch mode. The raw summary and PR objectives both describe a documentation-only change that adds a note on this timing, so the title matches the changeset.

Full details: Linked Issues check

Explanation

Issue #569 asks whether the different buildEnd timing in Vite and webpack should be handled with new hooks or documented. It sets no formal acceptance criteria. The PR chooses documentation. At the reviewed head, docs/guide/index.md states after the Supported Hooks table that in Vite dev mode buildEnd runs when the dev server closes, and in webpack it runs during compilation, including watch-mode rebuilds. It links to the existing ## Bundler-Specific Logic section. This meets the documentation objective. The diff tool was unavailable, so the base content was not compared line by line. The file read at head and the supplied summary (+4/-0, docs only) support this result. No coding requirements remain open.

Full details: Out of Scope Changes check

Explanation

The PR changes only the Supported Hooks documentation in docs/guide/index.md, with four added lines per the supplied summary. The added note states the buildEnd timing difference that #569 describes. It also links to the Bundler-Specific Logic section. The PR describes no runtime or API changes, and the summary reports no declaration changes. The diff tool was unavailable, so the absence of other changed files rests on the supplied summary and not on a full diff read.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · 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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4f3fc751-73ff-4e19-b8bb-119e7ad6fa69
Commits

Reviewing files that changed from the base of the PR and between 5daf6e6 and d19c69f.

Files selected for processing: 1

  • docs/guide/index.md

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

This branch has not been deployed

No deployments
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.

Is it expected that buildEnd works differently for different plugins?

1 participant