-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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: respect new port when change the config file #6075
Conversation
@CHOYSEN did you test what happens when you have two dev servers running (port 3000 and 3001) and change the port? |
It works as expect, i try to change the first dev server from 3000 to 3001. @patak-dev test@C02FV5VTMD6M vite-config-issue 2 % pnpm dev
> [email protected] dev /Users/test/Desktop/vite-config-issue 2
> vite
vite v2.7.1 dev server running at:
> Local: http://localhost:3000/
> Network: use `--host` to expose
ready in 403ms.
下午5:03:26 [vite] vite.config.ts changed, restarting server...
Port 3001 is in use, trying another one...
下午5:03:26 [vite] server restarted.
> Local: http://localhost:3002/
> Network: use `--host` to expose
|
9b0f389
For import { defineConfig } from "vite";
export default defineConfig({
server: {
port: 3000,
strictPort: true
}
}); Change to port 3001: test@C02FV5VTMD6M vite-config-issue 2 % yarn dev
yarn run v1.22.10
warning package.json: No license field
$ vite
vite v2.7.1 dev server running at:
> Local: http://localhost:3000/
> Network: use `--host` to expose
ready in 380ms.
上午11:30:31 [vite] vite.config.ts changed, restarting server...
Error: Port 3001 is already in use Change to port 3002: 上午11:31:07 [vite] vite.config.ts changed, restarting server...
上午11:31:07 [vite] server restarted.
> Local: http://localhost:3002/
> Network: use `--host` to expose
|
It would be nice to handle |
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.
Not sure what's up with CI, but this looks good to me.
I re-run the jobs, CI is a bit moody lately. We need to move away from Jest, we are working on it 😉 |
Description
Fixes #6074
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).