Static prerendering is the process of generating static HTML files for your application. This can be useful for either improving the performance of your application, as it allows you to serve pre-rendered HTML files to users without having to generate them on the fly or for deploying static sites to platforms that do not support server-side rendering.
TanStack Start can prerender your application to static HTML files, which can then be served to users without having to generate them on the fly. To prerender your application, you can add the server.prerender option to your app.config.js file:
// app.config.js
import { defineConfig } from '@tanstack/react-start/config'
export default defineConfig({
server: {
prerender: {
routes: ['/'],
crawlLinks: true,
},
},
})
// app.config.js
import { defineConfig } from '@tanstack/react-start/config'
export default defineConfig({
server: {
prerender: {
routes: ['/'],
crawlLinks: true,
},
},
})
Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.