Islands and deployment

Build and inspect the site

Treat the generated routes, assets, and browser requests as evidence of what will be deployed.

8 minute lesson

~~~

The production build is evidence, not a ceremony:

npm run build
npm run preview

Fix every build error before inspecting the result. Development mode can generate routes lazily, while the build must enumerate dynamic paths, validate content, resolve assets, and produce deployment output.

Check the built site from several angles:

  • open every route type, including one dynamic page and an unknown URL
  • follow internal links instead of testing only copied URLs
  • verify titles, descriptions, heading order, and useful HTML with JavaScript disabled
  • confirm image dimensions, alt text, and production asset URLs
  • filter the Network panel by JavaScript and explain every bundle
  • test endpoint status codes and response headers, not only response bodies

Look in dist/ as well. Static routes should have generated output. A missing route often points to getStaticPaths(), draft filtering, or an incorrect filename. Unexpected scripts often point to an unnecessary client directive.

Preview is close to production output, but it does not reproduce every hosting behavior. Redirects, caching, environment variables, and platform functions still need verification after deployment.

Lesson completed

Take this course offline

Get every free book and course as PDF and EPUB files.

Get the download library →