Svelte · Senior · Question 36 of 75

How do you prerender dynamic routes like /blog/[slug]?

export const prerender = true;
export function entries() {
  return [{ slug: "hello" }, { slug: "world" }];
}

Explanation

Prerendered pages must render the same for every user; pages using form actions can't be prerendered.

Further reading

Problem with a question

Svelte · Senior · question 36

Test yourself

Take the Svelte · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz