Skip to content

refactor(server): improve publicDir normalization#6360

Merged
chenjiahan merged 3 commits intomainfrom
public_dir_normalization_1014
Oct 15, 2025
Merged

refactor(server): improve publicDir normalization#6360
chenjiahan merged 3 commits intomainfrom
public_dir_normalization_1014

Conversation

@chenjiahan
Copy link
Member

Summary

  • Remove redundant publicDir normalization calls
  • Move publicDir normalization to config normalization phase
  • Update NormalizedServerConfig type definitions to reflect required publicDir field

Checklist

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

Copilot AI review requested due to automatic review settings October 14, 2025 14:30
@netlify
Copy link

netlify bot commented Oct 14, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 085c514
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/68ef071693b9a30008d45f40
😎 Deploy Preview https://deploy-preview-6360--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 69 (no change from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

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 refactors the server configuration to centralize publicDir normalization during the config normalization phase, eliminating redundant calls throughout the codebase. The changes improve code maintainability by ensuring publicDir is normalized once and available as a required field in NormalizedServerConfig.

  • Move publicDir normalization to the config normalization phase
  • Update type definitions to reflect normalized publicDir as a required field
  • Remove redundant normalization calls from server files

Reviewed Changes

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

Show a summary per file
File Description
packages/core/src/types/config.ts Update NormalizedServerConfig to include required normalized publicDir field
packages/core/src/defaultConfig.ts Move publicDir normalization to config structure phase and make function private
packages/core/src/server/watchFiles.ts Remove redundant normalization and use normalized publicDir directly
packages/core/src/server/devMiddlewares.ts Remove redundant normalization and use normalized publicDir directly
packages/core/src/plugins/server.ts Remove redundant normalization and use normalized publicDir directly

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@chenjiahan chenjiahan merged commit 76af941 into main Oct 15, 2025
11 checks passed
@chenjiahan chenjiahan deleted the public_dir_normalization_1014 branch October 15, 2025 02:47
@chenjiahan chenjiahan mentioned this pull request Oct 30, 2025
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.

1 participant