diff --git a/docs/content/3.guide/4.deploy/1.node-server.md b/docs/content/3.guide/4.deploy/1.node-server.md new file mode 100644 index 000000000..1713ca72e --- /dev/null +++ b/docs/content/3.guide/4.deploy/1.node-server.md @@ -0,0 +1,15 @@ +# Node Server + +Use the [`nuxi build` command](https://v3.nuxtjs.org//api/commands/build) to build your application. The JS files will be generated in the `.output` directory. + +```bash +npx nuxi build +``` + +Generated files are ready-to-run on Node environment. + +```bash +node .output/server/index.mjs +``` + +Read more about [Node Server deploy](https://v3.nuxtjs.org/guide/deploy/node-server) on Nuxt official docs. \ No newline at end of file diff --git a/docs/content/3.guide/4.deploy/2.static-hosting.md b/docs/content/3.guide/4.deploy/2.static-hosting.md new file mode 100644 index 000000000..008c34d19 --- /dev/null +++ b/docs/content/3.guide/4.deploy/2.static-hosting.md @@ -0,0 +1,33 @@ +# 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: false` and `service-worker` preset to produce a pure client-side output. + + +## Prerendering + +Use the [`nuxi generate` command](https://v3.nuxtjs.org//api/commands/generate) to build your application. The HTML files will be generated in the `.output/public` directory. + +```bash +npx nuxi generate +``` + +## Client-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. + +```ts [nuxt.config.ts|js] +defineNuxtConfig({ + ssr: false, + nitro: { + preset: 'service-worker' + } +}) +``` + +::alert{type=warning} +Nuxt Content highly depends on [Nuxt's server engine](https://v3.nuxtjs.org/guide/concepts/server-engine). The only way to have server engine in client only rendering is to use Service Workers. +:: + diff --git a/docs/content/3.guide/4.deploy/_dir.yml b/docs/content/3.guide/4.deploy/_dir.yml new file mode 100644 index 000000000..667e034cd --- /dev/null +++ b/docs/content/3.guide/4.deploy/_dir.yml @@ -0,0 +1 @@ +icon: heroicons-outline:book-open diff --git a/docs/content/3.guide/4.migration/1.from-v1.md b/docs/content/3.guide/5.migration/1.from-v1.md similarity index 100% rename from docs/content/3.guide/4.migration/1.from-v1.md rename to docs/content/3.guide/5.migration/1.from-v1.md diff --git a/docs/content/3.guide/4.migration/2.edge-channel.md b/docs/content/3.guide/5.migration/2.edge-channel.md similarity index 100% rename from docs/content/3.guide/4.migration/2.edge-channel.md rename to docs/content/3.guide/5.migration/2.edge-channel.md diff --git a/docs/content/3.guide/4.migration/_dir.yml b/docs/content/3.guide/5.migration/_dir.yml similarity index 100% rename from docs/content/3.guide/4.migration/_dir.yml rename to docs/content/3.guide/5.migration/_dir.yml