Opening non-default browser with lite-server in angular2 quick start guide

前端 未结 7 1290
庸人自扰
庸人自扰 2021-02-05 08:14

Having followed the TypeScript version of the Angular 2 Quick Start guide, I was wondering if it is possible, and if so how to configure the lite-server to launch a browser othe

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-05 08:41

    Using Debian/Ubuntu and update-alternatives

    I was able to confirm that you can change this process globally through this command here. Currently lite-server uses browser-sync which uses opn which bundles its own copy of a xdg-open. You can configure this with,

    sudo update-alternatives --config x-www-browser
    

    I found it preferable. It takes effect on all angular2 examples, and persists for the rest of the OS too. You can also make the links open in incognito (instructions in the link above).

提交回复
热议问题