Skip to content

Conversation

@fi3ework
Copy link
Member

@fi3ework fi3ework commented Oct 17, 2025

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

  • Tests updated (or not required).
  • Documentation updated (or not required).
@netlify
Copy link

netlify bot commented Oct 17, 2025

Deploy Preview for rslib ready!

Name Link
🔨 Latest commit d77978c
🔍 Latest deploy log https://app.netlify.com/projects/rslib/deploys/68f5aa6946ae7a0008256c6d
😎 Deploy Preview https://deploy-preview-1275--rslib.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@fi3ework fi3ework marked this pull request as ready for review October 17, 2025 08:23
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 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.

@Timeless0911 Timeless0911 enabled auto-merge (squash) October 20, 2025 03:22
@Timeless0911 Timeless0911 merged commit dd8f64d into main Oct 20, 2025
14 checks passed
@Timeless0911 Timeless0911 deleted the no-cofig branch October 20, 2025 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants