feat: add default favicon resolution from public dir#6362
Merged
chenjiahan merged 2 commits intomainfrom Oct 15, 2025
Merged
Conversation
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds automatic favicon resolution from the public directory, implementing a common convention that simplifies configuration for web applications. When no explicit favicon is configured, the system will look for favicon.ico, favicon.png, or favicon.svg files in public directories.
- Added default favicon resolution logic that searches public directories for favicon files
- Enhanced the HTML plugin to use the default favicon as a fallback when no explicit favicon is configured
- Added comprehensive test coverage for the new default favicon resolution functionality
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/core/src/plugins/html.ts | Implements default favicon resolution logic and integrates it as a fallback in the HTML plugin |
| e2e/cases/html/favicon/index.test.ts | Adds test cases for default favicon resolution and includes code formatting cleanup |
Comments suppressed due to low confidence (1)
packages/core/src/plugins/html.ts:1
- Line 239 assigns
defaultFaviconto itself instead of assigningfaviconPath. This should bedefaultFavicon = faviconPath;
import fs from 'node:fs';
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This was referenced Oct 15, 2025
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
This PR adds default support for resolving
public/favicon.[ext], a convention that helps simplify configuration for most web applications.This behavior aligns with common defaults in tools like Create React App and other web toolings.
By default,
.ico,.png, and.svgextensions are supported, which should cover the vast majority of use cases.Checklist