Skip to content

Commit 9882419

Browse files
Fix typo in SvelteKit $lib lesson (sveltejs#373)
1 parent 127ffce commit 9882419

File tree

1 file changed

+2
-2
lines changed
  • content/tutorial/03-sveltekit/05-shared-modules/01-lib

1 file changed

+2
-2
lines changed

content/tutorial/03-sveltekit/05-shared-modules/01-lib/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: The $lib alias
44

55
Because SvelteKit uses directory-based routing, it's easy to place modules and components alongside the routes that use them. A good rule of thumb is 'put code close to where it's used'.
66

7-
Sometimes, code is used in multiple places. When this happens, it's useful to have a place to put them that can be access by all routes without needing to prefix imports with `../../../../`. In SvelteKit, that place is the `src/lib` directory. Anything inside this directory can be accessed by any module in `src` via the `$lib` alias.
7+
Sometimes, code is used in multiple places. When this happens, it's useful to have a place to put them that can be accessed by all routes without needing to prefix imports with `../../../../`. In SvelteKit, that place is the `src/lib` directory. Anything inside this directory can be accessed by any module in `src` via the `$lib` alias.
88

99
Both `+page.svelte` files in this exercise import `src/lib/message.js`. But if you navigate to `/a/deeply/nested/route`, the app breaks, because we got the prefix wrong. Update it to use `$lib/message.js` instead:
1010

@@ -28,4 +28,4 @@ Do the same for `src/routes/+page.svelte`:
2828
2929
<h1>home</h1>
3030
<p>{message}</p>
31-
```
31+
```

0 commit comments

Comments
 (0)