0

I want to change where live-server opens, for example, I like using safari as my default browser, but every time I type live-server in the terminal it will open a window on safari. I know I can type live-server --browser='google chrome' but now I don't want to be typing that whole code to open in Chrome. I want to change it so that when I type live-sever it will open on chrome instead, I know I have to change that in the .json file but I'm not sure where it's located, or how to access it in the terminal. Thank you in advance.

Ervin001
  • 25
  • 3

2 Answers2

1

I have found the solution after searching on the internet and it' straightforward. You just have to change your selected browser from you pc settings. It worked for me I hope it will work for you too!

es93
  • 11
  • 1
0

I found two methods that will solve this. The first is to go into the live-server code and change where it opens to google chrome. The second which is much better IMO since you can do multiple options is as @Marc recommended, to use an npm script. A script will let you do multiple browsers. What I use now is the following script: "glive": "live-server --browser=\"google chrome\" --open=\"dist/index.html\"", The --open='dist/html'" is only needed if your file is in a folder

Ervin001
  • 25
  • 3