DEV Community

Cover image for Change your Sveltekit (or any vite-powered) dev server localhost port
Abdullah Bashir
Abdullah Bashir

Posted on

1

Change your Sveltekit (or any vite-powered) dev server localhost port

My dev server runs on 5173 by default. Let's say I wanted to change it to 5199:

import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
import fs from 'fs';

export default defineConfig({
    plugins: [sveltekit()],
// Added Config Part
    server: {
      port: 5199
    }
// Added Config Part End
});
Enter fullscreen mode Exit fullscreen mode

It works!

5199

Happy hacking!

PS: Relevant docs
PS2: Run your sveltekit (or any vite-powered) localhost dev server with HTTPS.

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more