Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add deploy section #1347

Merged
merged 3 commits into from
Jul 13, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/content/3.guide/5.deploy/1.node-server.md
Original file line number Diff line number Diff line change
@@ -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.
33 changes: 33 additions & 0 deletions docs/content/3.guide/5.deploy/2.static-hosting.md
Original file line number Diff line number Diff line change
@@ -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.
::

1 change: 1 addition & 0 deletions docs/content/3.guide/5.deploy/_dir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
icon: heroicons-outline:book-open