Skip to content

OrderNot attempted

This app's build pipeline

Order the steps of npm run build in this app.

Drag the rows, or use the arrows, to put them in order from first to last.

  1. Generate the sitemap and robots.txt
  2. Prerender: render each route to HTML, add its modulepreload links, write dist/<route>/index.html
  3. Server build of src/entry-server.tsx for Node (vite build --ssr)
  4. Client build (vite build): bundle, minify, split chunks, content-hash file names, write a manifest
  5. Type-check the project (tsc -b)
Show answer & explanation

Correct order:

  1. Type-check the project (tsc -b)
  2. Client build (vite build): bundle, minify, split chunks, content-hash file names, write a manifest
  3. Server build of src/entry-server.tsx for Node (vite build --ssr)
  4. Prerender: render each route to HTML, add its modulepreload links, write dist/<route>/index.html
  5. Generate the sitemap and robots.txt

The prerender needs both earlier builds: the Node build to run React (renderToString), and the client manifest to know each route's hashed chunk names for its modulepreload links. The sitemap is generated last from the final list of pages.