Skip to content

Bun Svelte

sh
bun create vite@latest

SvelteTypeScriptを選択。

3002portを使用する。

ts
import { defineConfig } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte'

const defaultPort = 3002

const port = process.env.PORT !== undefined ? parseInt(process.env.PORT) : defaultPort

// https://vitejs.dev/config/
export default defineConfig({
  server: {
    port,
  },
  plugins: [svelte()],
})
sh
bun run dev

Accesse Browser

http://localhost:3002

Change icon

href="/vite.svg"ここを変更すれば良い。

html
<link rel="icon" type="image/svg+xml" href="/vite.svg" />