{"id":86,"date":"2025-12-19T00:00:00","date_gmt":"2025-12-19T00:00:00","guid":{"rendered":"https:\/\/wordpress.securinsight.ca\/index.php\/2025\/12\/19\/workers-static-prerendering-support-for-tanstack-start-4\/"},"modified":"2025-12-19T00:00:00","modified_gmt":"2025-12-19T00:00:00","slug":"workers-static-prerendering-support-for-tanstack-start-4","status":"publish","type":"post","link":"https:\/\/wordpress.securinsight.ca\/index.php\/2025\/12\/19\/workers-static-prerendering-support-for-tanstack-start-4\/","title":{"rendered":"Workers &#8211; Static prerendering support for TanStack Start"},"content":{"rendered":"<p><a href=\"https:\/\/tanstack.com\/start\/\" target=\"_blank\">TanStack Start<\/a> apps can now prerender routes to static HTML at build time with access to build time environment variables<br \/>\nand bindings,  and serve them as <a href=\"https:\/\/developers.cloudflare.com\/workers\/static-assets\/\">static assets<\/a>. To enable prerendering, configure the <code>prerender<\/code> option of the TanStack Start plugin in your Vite config:<\/p>\n<div>\n<figure>\n<pre data-language=\"ts\"><code class=\"language-ts\"><div><div><span>import <\/span><span>{<\/span><span><span> <\/span><span>defineConfig<\/span><span> <\/span><\/span><span>}<\/span><span> from <\/span><span>\"vite\"<\/span><span>;<\/span><\/div><\/div><div><div><span>import <\/span><span>{<\/span><span><span> <\/span><span>cloudflare<\/span><span> <\/span><\/span><span>}<\/span><span> from <\/span><span>\"@cloudflare\/vite-plugin\"<\/span><span>;<\/span><\/div><\/div><div><div><span>import <\/span><span>{<\/span><span><span> <\/span><span>tanstackStart<\/span><span> <\/span><\/span><span>}<\/span><span> from <\/span><span>\"@tanstack\/react-start\/plugin\/vite\"<\/span><span>;<\/span><\/div><\/div><div><div>\n<\/div><\/div><div><div><span>export<\/span><span> <\/span><span>default<\/span><span> <\/span><span>defineConfig<\/span><span>(<\/span><span>{<\/span><\/div><\/div><div><div><span><span>  <\/span><\/span><span>plugins<\/span><span>:<\/span><span> [<\/span><\/div><\/div><div><div><span>    <\/span><span>cloudflare<\/span><span>(<\/span><span>{<\/span><span> viteEnvironment<\/span><span>:<\/span><span> <\/span><span>{<\/span><span> name<\/span><span>:<\/span><span> <\/span><span>\"ssr\"<\/span><span> <\/span><span>}<\/span><span> <\/span><span>}<\/span><span>)<\/span><span>,<\/span><\/div><\/div><div><div><span>    <\/span><span>tanstackStart<\/span><span>(<\/span><span>{<\/span><\/div><\/div><div><div><span><span>      <\/span><\/span><span>prerender<\/span><span>:<\/span><span> <\/span><span>{<\/span><\/div><\/div><div><div><span><span>        <\/span><\/span><span>enabled<\/span><span>:<\/span><span> <\/span><span>true<\/span><span>,<\/span><\/div><\/div><div><div><span>      <\/span><span>},<\/span><\/div><\/div><div><div><span>    <\/span><span>}<\/span><span>)<\/span><span>,<\/span><\/div><\/div><div><div><span><span>  <\/span><\/span><span>]<\/span><span>,<\/span><\/div><\/div><div><div><span>}<\/span><span>)<\/span><span>;<\/span><\/div><\/div><\/code><\/pre>\n<div><\/div>\n<\/figure>\n<\/div>\n<p>This feature requires <code>@tanstack\/react-start<\/code> v1.138.0 or later. See the <a href=\"https:\/\/developers.cloudflare.com\/workers\/framework-guides\/web-apps\/tanstack-start\/#static-prerendering\">TanStack Start framework guide<\/a> for more details.<\/p>","protected":false},"excerpt":{"rendered":"<p>TanStack Start apps can now prerender routes to static HTML at build time with access to build time environment variables and bindings, and serve them as static assets. To enable prerendering, configure the prerender option of the TanStack Start plugin in your Vite config: import { defineConfig } from &#8220;vite&#8221;;import { cloudflare } from &#8220;@cloudflare\/vite-plugin&#8221;;import [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-86","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/posts\/86","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/comments?post=86"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/posts\/86\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/media?parent=86"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/categories?post=86"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/tags?post=86"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}