Skip to content

docs: correct default buildDependencies #5222

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

Merged
merged 1 commit into from
May 12, 2025

Conversation

colinaaa
Copy link
Contributor

@colinaaa colinaaa commented May 12, 2025

Summary

The .env and .env.* files are included in buildDependencies within the createRsbuild function. This setup allows these files to be utilized by frameworks built on top of Rsbuild, such as Rspeedy and Rslib.

if (config.performance?.buildCache) {
const { buildCache } = config.performance;
if (buildCache === true) {
config.performance.buildCache = {
buildDependencies: envs.filePaths,
};
} else {
buildCache.buildDependencies ||= [];
buildCache.buildDependencies.push(...envs.filePaths);
}
}

In contrast, the rsbuild.config.* files are added to buildDependencies within the loadConfig function.

const applyMetaInfo = (config: RsbuildConfig) => {
config._privateMeta = { configFilePath };
return config;
};

However, this does not apply to Rspeedy, as it does not utilize the loadConfig function from Rsbuild.

It does work in Rslib and Rspress (using rslib.config.* and rspress.config.*), so I'm uncertain if the current explanation for rsbuild.config.* is sufficiently clear.

Related Links

See lynx-family/lynx-stack#766

Checklist

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

Copy link

netlify bot commented May 12, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 038c329
🔍 Latest deploy log https://app.netlify.com/sites/rsbuild/deploys/682177f682e9960008641092
😎 Deploy Preview https://deploy-preview-5222--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: 74 (🟢 up 1 from production)
Accessibility: 97 (no change from production)
Best Practices: 92 (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.

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 👍

When using JavaScript API, the default value depends on the parameters of createRsbuild(), I will add more description later.

@chenjiahan chenjiahan merged commit 3d2071b into web-infra-dev:main May 12, 2025
13 checks passed
@chenjiahan chenjiahan mentioned this pull request May 12, 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.

2 participants