-
Notifications
You must be signed in to change notification settings - Fork 159
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
fix: do not open browser when open parameter is set to false #4291
Conversation
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
const { open } = config.server; | ||
|
||
if (typeof open === 'boolean') { | ||
return { targets: [] }; | ||
return { targets: [], skip: !open }; |
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.
This doesn't seem necessary, the server plugin already checks if open
is false:
https://github.com/web-infra-dev/rsbuild/blob/main/packages/core/src/plugins/server.ts#L15
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.
Then there must be something else wrong as
import { defineConfig } from '@rsbuild/core';
import { pluginReact } from '@rsbuild/plugin-react';
export default defineConfig({
plugins: [pluginReact()],
server: {
open: false,
},
});
still opens the browser after the server started.
i am using "@rsbuild/core": "^1.1.13"
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.
Are you using the --open
CLI flag? The CLI flag takes precedence over the configurations,
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.
oh no, it is part of the package dev script. thanks. sorry for the confusion. will close it.
Summary
Allows to disable browser opening by setting the open parameter to false.
Related Links
Checklist