Skip to content

feat: support dev.lazyCompilation.serverUrl use '<port>' placeholder #5035

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

gaoachao
Copy link
Contributor

@gaoachao gaoachao commented Apr 16, 2025

Summary

Although Rsbuild doesn't directly support setting dev.lazyCompilation with a custom serverUrl, we can leverage api.modifyRsbuildConfig to modify both assetPrefix and dev.lazyCompilation.serverUrl. However, there's an inconsistency: assetPrefix will find and replace <port> placeholders, while dev.lazyCompilation.serverUrl does not perform this replacement, leading to configuration mismatches.

dev: {
    assetPrefix: 'http://xxx:<port>/',
    lazyCompilation: {
      serverUrl: 'http://xxx:<port>/'
      // ...
    }
},

Therefore, in the lazyCompilationMiddleware, we need to check if is present in the URL, and if so, we need to replace it.

Related Links

Checklist

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

@CLAassistant
Copy link

CLAassistant commented Apr 16, 2025

CLA assistant check
All committers have signed the CLA.

Copy link

netlify bot commented Apr 16, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 34ef886
🔍 Latest deploy log https://app.netlify.com/sites/rsbuild/deploys/67ffa9825b4ee00008bc2cea
😎 Deploy Preview https://deploy-preview-5035--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: 81 (🟢 up 7 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 site configuration.

@gaoachao gaoachao force-pushed the feat/support-lazy-compilation-server-url branch from b1fd1fd to 34ef886 Compare April 16, 2025 12:58
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👍 Thank you!

@chenjiahan chenjiahan merged commit ca7ce9c into web-infra-dev:main Apr 16, 2025
12 checks passed
@chenjiahan chenjiahan changed the title feat: support dev.lazyCompilation.serverUrl use <port> feat: support dev.lazyCompilation.serverUrl use '<port>' placeholder Apr 16, 2025
@gaoachao gaoachao deleted the feat/support-lazy-compilation-server-url branch April 16, 2025 13:52
@chenjiahan chenjiahan mentioned this pull request Apr 17, 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.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy