-
-
Notifications
You must be signed in to change notification settings - Fork 53
feat: support build without config file #1275
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
✅ Deploy Preview for rslib ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this 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 enables Rslib to build projects without requiring a configuration file. When no rslib.config.*
file is present, the CLI falls back to a default configuration with a single library entry and accepts all build options from command-line arguments.
Key Changes:
- Modified config resolution to return
undefined
instead of throwing an error when no config file is found - Added fallback logic to create a default
lib
configuration when no config file exists - Updated tests to verify building without a config file works correctly
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
packages/core/src/config.ts | Changed resolveConfigPath to return undefined instead of throwing when config is missing; loadConfig now returns empty lib array when no config found |
packages/core/src/cli/initConfig.ts | Added logic to initialize default lib config when configFilePath is undefined; filters out undefined values from watchFiles |
tests/integration/cli/build/build.test.ts | Updated test from expecting an error to verifying successful build output without config file |
tests/integration/cli/build/no-config/src/index.ts | Changed test data from string to numeric constant |
website/docs/en/guide/basic/cli.mdx | Added documentation note explaining fallback behavior when config file is absent |
website/docs/zh/guide/basic/cli.mdx | Added Chinese translation of fallback behavior documentation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Summary
support run command without config file.
when no config is present, Rslib will use a fallback
lib
object accept options from CLI.Related Links
Checklist