Skip to content

Search documentation

Find Svelte Patterns and Svelte reference pages.

No results for ""

Try a shorter query or a related Svelte term.

# Describe the problem

While npm run dev is a great dev experience in conjunction with HMR. I want to preview the app on my machine similar to production environment before I deploy.

# Do not use

# npm run preview

Under the hood, it runs vite preview. Even though it is part of the official docs. Its behaviours are not representative of a production server.

# adapter-static

npm run build
npx http-server build

# adapter-node

This also applies to node adjacent runtimes like bun and deno as well as serverless runtimes like cloudflare and vercel.

npm run build
node build