Static Hosting
There are two ways to deploy a Content application to any static hosting services:
- Static site generation (SSG) prerenders every route of your application at build time. For every page, Nuxt uses a crawler to generate a corresponding HTML file.
- Using
ssr: falseandservice-workerpreset to produce a pure client-side output.
Prerendering
Use the nuxi generate command to build your application. The HTML files will be generated in the .output/public directory.
npx nuxi generateClient-side only rendering
If you don't want to prerender your routes, another way of using static hosting is to set the ssr property to false and nitro.preset to service-worker in the nuxt.config file. The nuxi build command will then output an index.html entrypoint like a classic client-side Vue.js application.
nuxt.config.ts|js
defineNuxtConfig({ ssr: false, nitro: { preset: 'service-worker' }})Nuxt Content highly depends on Nuxt's server engine. The only way to have server engine in client-only rendering is to use Service Workers.
Table of Contents