Skip to content
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

默认打开浏览器时,可以优先使用 localhost 而不是一个 IP 地址吗? #15608

Closed
Jeff-Tian opened this issue May 2, 2024 · 2 comments
Labels
enhancement New feature or request T-h5 Target - 编译到 H5

Comments

@Jeff-Tian
Copy link
Contributor

这个特性解决了什么问题?

如果使用 http://localhost:10086 会更好一点,但不知道从哪个版本开始,总是默认使用 http://ip:100i86 了。尝试通过 --host localhost 指定主机名,也不起作用。

这个 API 长什么样?

默认打开 http://localhost:10086

@taro-bot2 taro-bot2 bot added enhancement New feature or request labels May 2, 2024
@ZakaryCode ZakaryCode added the T-h5 Target - 编译到 H5 label May 3, 2024
@ZakaryCode
Copy link
Contributor

自行配制下 devServer.open 即可

This was referenced May 4, 2024
@Jeff-Tian
Copy link
Contributor Author

感谢指点,果然通过增加如下修改解决了。

	  devServer: {
		  host: 'localhost'
	  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request T-h5 Target - 编译到 H5
Projects
Archived in project
Development

No branches or pull requests

2 participants