How to change the default port 5000 in svelte?

Hypermystic picture Hypermystic · Aug 20, 2019 · Viewed 7.4k times · Source

I am not getting how to change the default 5000 port in svelte to some other port if we install the sample template through degit.

Answer

CD.. picture CD.. · Aug 20, 2019

The sveltejs/template uses sirv-cli.
You can add --port or -p in your start:dev script in package.json.

Instead of:

"start:dev": "sirv public --single --dev"

Use:

"start:dev": "sirv public --single --dev --port 5555"

You can see more of sirv-cli options:

https://github.com/lukeed/sirv/tree/master/packages/sirv-cli