Buy Now and unlock this series
$
49
.99
yours forever
$
49
.99
Become a Pro and unlock everything
$
24
.99
per month
$
24
.99
Glob Imports
Here we will look at gob imports, a feature from Vite. Using glob imports will give us a quick and easy way to import all of our posts within one folder at once.
Downloads
Become a pro to download code and videos
Svelte Kit
24 videos
Released: May 31 2021Course Instructor
Scott Tolinski
- What Is Svelte Kit
7m23s - Getting Started
8m22s - Exploring the Svelte Kit Demo
17m16s - Starting From A Skeleton
9m29s - Pages, Routing and Layouts In Svelte Kit
7m53s - The $lib Directory
4m58s - CSS In Svelte Kit - PostCSS, Scss & Scoping
11m35s - Tailwinds With PostCSS
9m41s - API Routes
5m49s - Nested Layouts
8m25s - Layout Resets
2m56s - Parameter Based File Names
8m2s - Loading Data Before Initial Render
9m24s - Markdown with MDSVEX
6m58s - Dynamic Imports and Frontmatter
6m36s - Frontmatter with MDSVEX
7m16s - Glob Imports
14m27s - Loading in Depth
14m50s - Error Pages
7m33s - Prefetch and Other Anchor Options
6m9s - Static Site Generation and Adapters
9m5s - Hosting On Render
6m49s - Building For Node
4m46s - TypeScript In Svelte Kit
5m50s
Comments
Brian
9 months ago
Is there a way to force the < Hello /> component to re-render on route change?
I know this is old but I'll answer anyway in case it helps someone new here...
According to vite in my console, the Hello component will not be reactive if Hello changes. Use <svelte:component this={Hello}/> if you want this reactivity.
So change:
<Hello />
to:<svelte:component this={Hello} />
It will then re-render on route change.
Devang
7 months ago
Got the same vite warning as you. Replacing
<Hello/>
with<svelte:component this={Hello} />
does the trick.Andy
10 months ago
Is anyone else having trouble with the slug? The approach explained in the video for programmatically creating the hrefs in the archive works if I am on one of the post detail pages, but not if I'm on the post index page. For example, on the post detail page, the link generated for the first post is "http://localhost:3000/posts/goodbye" (which is correct), but on the index it is "http://localhost:3000/goodbye" (which is not). Any idea what is going on?
Russ
11 months ago
I had to make my in order for it to work correctly?
DumDumDev
about 1 year ago
Bingo Bango. Love that and need to start using it.
Spenser
about 1 year ago
@Scott Thanks Scott. Actually in the very next lesson @lee gives the solution and as per usual with svelte its simple and elegant. So anyone stuck on my issue just peak the comments in the next lesson.
Scott
about 1 year ago
@Spenser Very odd. I'll fire mine up and give it a look.
Edwin
about 1 year ago
I also have the same question as Spenser, It doesn't re-render the page again, it stays the same.
Spenser
about 1 year ago
Is there a way to force the < Hello /> component to re-render on route change? When I click the 'Hello' link I go to the Hello page but then from there if I click my 'Goodbye' link the route changes and it does even go and get the correct .md file and everything but the content in the < Hello /> component stays the same unless I reload the page. Any thoughts?
Want to join the conversation?
Become a Pro member today!