Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cotyhamilton/deno-sveltekit
deno + sveltekit how to
https://github.com/cotyhamilton/deno-sveltekit
deno svelte sveltekit
Last synced: about 2 months ago
JSON representation
deno + sveltekit how to
- Host: GitHub
- URL: https://github.com/cotyhamilton/deno-sveltekit
- Owner: cotyhamilton
- Created: 2024-08-31T00:48:47.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-10-24T16:37:43.000Z (3 months ago)
- Last Synced: 2024-10-25T23:26:19.105Z (3 months ago)
- Topics: deno, svelte, sveltekit
- Language: TypeScript
- Homepage: https://deno-sveltekit-example.deno.dev
- Size: 622 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# deno sveltekit
## create project
```bash
deno run -A npm:sv@latest create my-app
cd my-app
deno add npm:@types/deno
```## replace adapter
> ⚠️ Soon this won't be needed, follow [this issue](https://github.com/denoland/deno/issues/17248) for updates
I like [sveltekit-adapter-deno](https://github.com/dbushell/sveltekit-adapter-deno)
The rest of the instructions are tailored to using this adapter, adjust as needed if you choose differently.
```bash
deno remove @sveltejs/adapter-auto
deno add npm:sveltekit-adapter-deno
```Update `svelte.config.js`
```diff
- import adapter from '@sveltejs/adapter-auto';
+ import adapter from 'sveltekit-adapter-deno';
```## develop
Install dependencies
```bash
deno install
```Run the dev server
```bash
deno task dev
```## build
```bash
deno task build
```Run production server
```bash
deno run -REN build/mod.ts
```## deploy
Create project on [deno deploy](https://dash.deno.com/projects) and link repo
Svelte will be automatically selected as the framework preset
Open advanced settings
- Set "Install Step" to `deno install`
- Set "Build Step" to `deno task build`
- Set "Root directory" to `build`
- Set "Entrypoint" to `mod.ts`Alternatively, deploy from the command line:
```bash
deno task build
cd build
deployctl deploy --project= --entrypoint=mod.ts
```## live example
https://deno-sveltekit-example.deno.dev