You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/migrating/01-migrating.md
+12-1Lines changed: 12 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,4 +2,15 @@
2
2
title: Migrating
3
3
---
4
4
5
-
SvelteKit is largely backwards-compatible with Sapper. However, there are a number of differences. See https://github.com/sveltejs/kit/issues/34 for more details until this page is fleshed out.
5
+
SvelteKit is largely backwards-compatible with Sapper. However, there are a number of differences.YOu may find it helpful to view the [examples](https://github.com/sveltejs/kit/tree/master/examples) while migrating.
6
+
7
+
- Remove `rollup.config.js` or `webpack.config.js` and replace with [`vite.config.js`](https://github.com/sveltejs/kit/blob/master/packages/create-svelte/template/vite.config.js)
8
+
- Add a [`svelte.config.cjs`](https://github.com/sveltejs/kit/blob/master/packages/create-svelte/template/svelte.config.cjs) with the adapter of your choice
9
+
- Update your `template.html` to [`app.html`](https://github.com/sveltejs/kit/blob/master/packages/create-svelte/template/src/app.html)
10
+
- It should have a `<div id="svelte">` (or `id` matching `target` in `svelte.config.cjs`)
11
+
- The error and layout pages should prefixed by `$` instead of `_`
12
+
- Replace imports from `@sapper/app` with imports from `$app/navigation` and `$app/stores` and update APIs accordingly
13
+
- If you have `src/node_modules/components`, move it to `src/components` and update the import path to `$components`
14
+
- Move any custom `client.js` code to `$layout.svelte` and put it in an `if (browser)` check (`import { browser } from "$app/env";`).
15
+
-`preload` has been renamed to `load`. It has a new method signature and return values
16
+
-`sapper:prefetch` and `sapper:noscroll` have been renamed to `sveltekit:prefetch` and `sveltekit:noscroll`
0 commit comments