{"repo":"Munawwar/preact-mpa-template","free":true,"listed":false,"github":"https://github.com/Munawwar/preact-mpa-template","clone":"git clone https://github.com/Munawwar/preact-mpa-template.git","description":"⚛️ Preact Multi-Page Website Starter Template (SSR) - with fastify and esbuild 🚀","language":"JavaScript","stars":14,"topics":["preact","preact-ssr-boilerplates","preact-template","preact-app","preact-apps","preact-boilerplate"],"license":"MIT","category":"saas-starters-boilerplates","readme_excerpt":"preact-mpa-template Example repo to start a multi-page app/website (MPA) with Preact, fastify and esbuild (vite version here). If you don't need server side rendering (SSR) check preact-spa-template. - 🐢 JS, CSS, image files are content hashed (\"fingerprinted\") on prod for long lived caching - 🤵‍♂️ Fastify server (More performant than Express, can add HTTP/2 support) - 🔄 Live reload¹ - ✂️ Shared code chunks / Code splitting (read esbuild docs for caveats) - 🚀 Preload shared chunks - 🗲 Preloads pages on mouse hover / touch start (using instant.page²) - 🌐 Static files deployable to S3 behind a CDN VSCode note: Install es6-string-html extension to syntax highlight HTML inside of JS template literals. ¹ Live Reload here means: - Changes to CSS and JS are reflected on page without page reload - JS reload unmounts and remounts the page component - Changes to public files not part of build (like instant-page script) refreshes via a full page reload - Changes to node.js server routes are hot reloaded - Route handlers are also lazy loaded, to not only get the hot reloading to work, but also: 1. to keep dev server restarts fast (restart are needed when editing common server code outside routes) 2. to keep cold start time low, if you plan to deploy this to serverless environments like GCP Cloud Run ² the hosted version of instant.page doesn't have prerender option, so I had to minify myself Structure Example server uses a config file for mapping URL pattern to server handling func","default_branch":null,"files":null,"tree":[],"storefront":"/r/Munawwar","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Munawwar/preact-mpa-template/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}