Logo

dev-resources.site

for different kinds of informations.

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

Published at
8/27/2024
Categories
vite
sveltekit
localhost
svelte
Author
Abdullah Bashir
Categories
4 categories in total
vite
open
sveltekit
open
localhost
open
svelte
open
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
});

It works!

5199

Happy hacking!

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

Featured ones: