Skip to content

feat: add support for native html plugin implementation#6504

Merged
chenjiahan merged 4 commits intomainfrom
html_implementation_1105
Nov 5, 2025
Merged

feat: add support for native html plugin implementation#6504
chenjiahan merged 4 commits intomainfrom
html_implementation_1105

Conversation

@chenjiahan
Copy link
Member

Summary

  • Add implementation option to html config to allow switching between js and native html plugins
  • modify related plugins to support dynamic html plugin selection

Checklist

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

Copilot AI review requested due to automatic review settings November 5, 2025 07:45
@netlify
Copy link

netlify bot commented Nov 5, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit b1b42f6
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/690b07d1cc69970008484108
😎 Deploy Preview https://deploy-preview-6504--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: 70 (🟢 up 4 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 adds support for configuring HTML generation implementation in Rsbuild, allowing users to choose between the JavaScript-based html-rspack-plugin and Rspack's native Rust-based HtmlRspackPlugin. The implementation is made configurable via the new html.implementation option.

Key changes:

  • Introduces a new html.implementation configuration option ('js' or 'native') with 'js' as the default
  • Refactors HTML plugin resolution to be dynamic based on the configuration
  • Updates all plugin instances to receive the HTML plugin resolver as a dependency injection

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/core/src/types/config.ts Adds HtmlImplementation type and implementation field to HtmlConfig
packages/core/src/defaultConfig.ts Sets default value of implementation to 'js'
packages/core/src/pluginHelper.ts Updates getHTMLPlugin to accept config and return appropriate plugin based on implementation setting
packages/core/src/provider/rspackConfig.ts Passes environment config to getHTMLPlugin call
packages/core/src/plugins/html.ts Creates local getHTMLPlugin function and passes it to RsbuildHtmlPlugin
packages/core/src/plugins/resourceHints.ts Imports and passes getHTMLPlugin function to resource hints plugins
packages/core/src/rspack-plugins/RsbuildHtmlPlugin.ts Accepts getHTMLPlugin function as constructor parameter and removes direct import
packages/core/src/rspack-plugins/resource-hints/HtmlResourceHintsPlugin.ts Accepts getHTMLPlugin function as constructor parameter and removes direct import

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

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chenjiahan chenjiahan merged commit 283f735 into main Nov 5, 2025
11 checks passed
@chenjiahan chenjiahan deleted the html_implementation_1105 branch November 5, 2025 08:30
@chenjiahan chenjiahan mentioned this pull request Nov 5, 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