{"repo":"antfu-collective/vite-ssg","free":true,"listed":false,"github":"https://github.com/antfu-collective/vite-ssg","clone":"git clone https://github.com/antfu-collective/vite-ssg.git","description":"Static site generation for Vue 3 on Vite","language":"TypeScript","stars":1575,"topics":["vue","vite","ssg","ssr"],"license":"MIT","category":"ui-components","readme_excerpt":"Vite SSG Static-site generation for Vue 3 on Vite. ℹ️ ESM-only from v27.0.0 (CJS generation format also dropped). ℹ️ Vite 2 is supported from v0.2.x , Vite 1's support is discontinued. Install This library requires Node.js version = 14 npm i -D vite-ssg vue-router @unhead/vue How to allow Rollup tree-shake your client code In order to allow Rollup tree-shake your client code at build time, you need to wrap your code using import.meta.env.SSR , that's, checking if the build is for the server: Rollup will remove the server code from the client build. Single Page SSG For SSG of an index page only (i.e. without vue-router ); import vite-ssg/single-page instead, and only install @unhead/vue ( npm i -D vite-ssg @unhead/vue ). The ClientOnly component is registered globally when the app is created. Document head We ship @unhead/vue v2 to manage the document-head out of the box. You can use it directly in your pages/components. For example: That's all! No configuration is needed. Vite SSG will automatically handle the server-side rendering and merging. See @unhead/vue v2 's docs for more usage information about useHead . Critical CSS Vite SSG has built-in support for generating Critical CSS inlined in the HTML via the beasties package. Install it with: Critical CSS generation will automatically be enabled for you. To configure beasties , pass its options into ssgOptions.beastiesOptions in vite.config.ts : Initial State The initial state comprises data that is serialized with your ser","default_branch":null,"files":null,"tree":[],"storefront":"/r/antfu-collective","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/antfu-collective/vite-ssg/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."}