Skip to content

Commit a4c4d46

Browse files
authored
Start on a migration guide (#500)
1 parent 41384d7 commit a4c4d46

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

documentation/migrating/01-migrating.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,15 @@
22
title: Migrating
33
---
44

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

Comments
 (0)