Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions docs/content/3.rendering/6.svelte.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,25 @@ const config = {
export default config
```

SvelteKit 3 no longer reads `svelte.config.js`; pass the same options to the `sveltekit()` plugin instead:

```ts [vite.config.ts]
import { sveltekit } from '@sveltejs/kit/vite'
import { defineConfig } from 'vite'

export default defineConfig({
plugins: [
sveltekit({
compilerOptions: {
experimental: {
async: true,
},
},
}),
],
})
```

```svelte [App.svelte]
<script lang="ts">
import { MarkdownAsync } from '@comark/svelte/async'
Expand Down
4 changes: 4 additions & 0 deletions examples/1.frameworks/sveltekit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"version": "0.0.1",
"private": true,
"type": "module",
"imports": {
"#lib": "./src/lib",
"#lib/*": "./src/lib/*"
},
"scripts": {
"dev": "vite dev",
"build": "vite build",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { lazyMarkdown } from '$lib/content'
import { lazyMarkdown } from '#lib/content.ts'

export const load = () => {
return {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { parseMarkdown } from 'comark'
import { stableMarkdown } from '$lib/content'
import { stableMarkdown } from '#lib/content.ts'

export const load = async () => {
return {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { MarkdownDocument } from '@comark/svelte'
import { pascalCase } from 'comark/utils'
import Alert from '$lib/components/comark/Alert.svelte'
import Alert from '#lib/components/comark/Alert.svelte'
import type { PageData } from './$types'

let { data }: { data: PageData } = $props()
Expand Down
17 changes: 0 additions & 17 deletions examples/1.frameworks/sveltekit/svelte.config.js

This file was deleted.

6 changes: 4 additions & 2 deletions examples/1.frameworks/sveltekit/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "./.svelte-kit/tsconfig.json",
"extends": "$app/tsconfig",
"compilerOptions": {
"allowJs": true,
"allowImportingTsExtensions": true,
Expand All @@ -11,5 +11,7 @@
"sourceMap": true,
"strict": true,
"moduleResolution": "bundler"
}
},
"include": ["src", "test", "*"],
"exclude": ["src/service-worker"]
}
14 changes: 13 additions & 1 deletion examples/1.frameworks/sveltekit/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
import adapter from '@sveltejs/adapter-auto'
import { sveltekit } from '@sveltejs/kit/vite'
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
import { defineConfig } from 'vite'

export default defineConfig({
plugins: [sveltekit()],
plugins: [
sveltekit({
adapter: adapter(),
compilerOptions: {
experimental: {
async: true,
},
},
preprocess: vitePreprocess(),
}),
],
})
65 changes: 51 additions & 14 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ catalog:
"@shikijs/primitive": ^4.4.3
"@shikijs/themes": ^4.4.3
"@shikijs/twoslash": ^4.4.3
"@sveltejs/adapter-auto": ^7.0.1
"@sveltejs/kit": ^2.70.3
"@sveltejs/adapter-auto": ^8.0.0
"@sveltejs/kit": ^3.1.0
"@sveltejs/package": ^2.5.8
"@sveltejs/vite-plugin-svelte": ^7.3.0
"@tailwindcss/postcss": ^4.3.3
Expand Down
Loading