mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-11 04:22:13 +00:00
45 lines
1.5 KiB
Markdown
45 lines
1.5 KiB
Markdown
# SvelteKit
|
|
|
|
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte), deployed to [Vercel](https://vercel.com).
|
|
|
|
## Deploy Your Own
|
|
|
|
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fvercel%2Ftree%2Fmain%2Fexamples%2Fsveltekit&project-name=sveltekit-vercel&repository-name=sveltekit-vercel&demo-title=SvelteKit%20%2B%20Vercel&demo-description=A%20SvelteKit%20app%20optimized%20Edge-first.&demo-url=https%3A%2F%2Fsveltekit.examples.vercel.com%2F)
|
|
|
|
_Live Example: https://sveltekit.examples.vercel.com_
|
|
|
|
## Creating a project
|
|
|
|
If you're seeing this, you've probably already done this step. Congrats!
|
|
|
|
```bash
|
|
# create a new project in the current directory
|
|
npm init svelte@next
|
|
|
|
# create a new project in my-app
|
|
npm init svelte@next my-app
|
|
```
|
|
|
|
> Note: the `@next` is temporary
|
|
|
|
## Developing
|
|
|
|
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
|
|
|
|
```bash
|
|
npm run dev
|
|
|
|
# or start the server and open the app in a new browser tab
|
|
npm run dev -- --open
|
|
```
|
|
|
|
## Building
|
|
|
|
This uses the adapter-auto for SvelteKit, which detects Vercel and runs adapter-vercel on your behalf.
|
|
|
|
```bash
|
|
npm run build
|
|
```
|
|
|
|
> You can preview the built app with `npm run preview`, regardless of whether you installed an adapter. This should _not_ be used to serve your app in production.
|