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.
- Generate the sitemap and robots.txt
- Prerender: render each route to HTML, add its
modulepreloadlinks, writedist/<route>/index.html - Server build of
src/entry-server.tsxfor Node (vite build --ssr) - Client build (
vite build): bundle, minify, split chunks, content-hash file names, write a manifest - Type-check the project (
tsc -b)
Show answer & explanation
Correct order:
- Type-check the project (
tsc -b) - Client build (
vite build): bundle, minify, split chunks, content-hash file names, write a manifest - Server build of
src/entry-server.tsxfor Node (vite build --ssr) - Prerender: render each route to HTML, add its
modulepreloadlinks, writedist/<route>/index.html - 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.