Skip to content

Comments

feat(core): add ignore option for public directory copy in server plugin#7023

Merged
chenjiahan merged 5 commits intoweb-infra-dev:mainfrom
JSH-data:feature/6337/public-ignore-option
Jan 24, 2026
Merged

feat(core): add ignore option for public directory copy in server plugin#7023
chenjiahan merged 5 commits intoweb-infra-dev:mainfrom
JSH-data:feature/6337/public-ignore-option

Conversation

@JSH-data
Copy link
Contributor

@JSH-data JSH-data commented Jan 23, 2026

Summary

This PR provides an enhancement addressing issue #6337
It adds a new server. publicDir.ignore option that enables pattern-based exclusion of files from the public directory.

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @JSH-data, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant enhancement to the server plugin by adding a new ignore option within the server.publicDir configuration. This feature allows developers to specify glob patterns for files that should be excluded when copying the public directory to the build output. This directly addresses issue #6337, providing greater control over the build process and ensuring only necessary assets are included in the final distribution.

Highlights

  • New ignore option: Introduced server.publicDir.ignore to allow pattern-based exclusion of files from the public directory during the build process.
  • Glob pattern support: The ignore option supports glob patterns, enabling flexible file exclusion based on specified criteria.
  • Enhanced public directory handling: The server plugin now incorporates this ignore logic, preventing unwanted files from being copied to the distribution directory.
  • E2E test coverage: A new end-to-end test has been added to verify the correct functionality of the ignore option, ensuring ignored files are not copied.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@JSH-data JSH-data marked this pull request as ready for review January 23, 2026 09:18
Copilot AI review requested due to automatic review settings January 23, 2026 09:18
@JSH-data JSH-data force-pushed the feature/6337/public-ignore-option branch from 481e2fe to 6eb2af9 Compare January 23, 2026 09:19
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new ignore option for the server.publicDir configuration, allowing users to exclude specific files or directories from being copied to the output directory based on glob patterns. The implementation correctly integrates tinyglobby for pattern matching and includes necessary type definitions and a comprehensive E2E test case. The changes are well-structured and address the reported issue effectively.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new ignore option to the server.publicDir configuration, enabling pattern-based exclusion of files when copying from the public directory. This addresses issue #6337 by providing users with fine-grained control over which public files should be excluded from the build output.

Changes:

  • Added ignore property to PublicDirOptions type accepting glob patterns
  • Implemented filtering logic using tinyglobby to skip matched files during copy operations
  • Added default empty array for ignore in config normalization
  • Created e2e test validating the ignore functionality

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
packages/core/src/types/config.ts Adds optional ignore property to PublicDirOptions type definition
packages/core/src/plugins/server.ts Implements filtering logic to exclude files matching ignore patterns during public directory copy
packages/core/src/defaultConfig.ts Sets default empty array for ignore option in config normalization
e2e/cases/server/public-dir/publicDir.test.ts Adds test case verifying files matching ignore patterns are excluded from build output

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JSH-data JSH-data force-pushed the feature/6337/public-ignore-option branch from 6eb2af9 to 37ac70b Compare January 23, 2026 16:18
@JSH-data JSH-data requested a review from Copilot January 23, 2026 16:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JSH-data
Copy link
Contributor Author

@chenjiahan

Hello, could you please take a look at this PR? The CI does not seem to be working.

Thank you for your time!

@chenjiahan
Copy link
Member

Thank you for your contribution! I will take a look

Copy link
Member

@chenjiahan chenjiahan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

By the way, I'm considering using CopyRspackPlugin to copy public files in Rsbuild v2, so I may change this option from ignore to globOptions.ignore in another PRs, see https://rspack.rs/plugins/rspack/copy-rspack-plugin#globoptions

@chenjiahan chenjiahan enabled auto-merge (squash) January 24, 2026 00:46
@chenjiahan chenjiahan merged commit 8a6b55d into web-infra-dev:main Jan 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants