Skip to content

Commit

Permalink
docs: add deploy section (#1347)
Browse files Browse the repository at this point in the history
* docs: add deploy section

* Update docs/content/3.guide/5.deploy/2.static-hosting.md

Co-authored-by: nobkd <[email protected]>

* docs: add deploy fourth

Co-authored-by: nobkd <[email protected]>
Co-authored-by: Sébastien Chopin <[email protected]>
  • Loading branch information
3 people authored Jul 13, 2022
1 parent 56a234c commit 2c1d694
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/content/3.guide/4.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/4.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/4.deploy/_dir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
icon: heroicons-outline:book-open
File renamed without changes.

0 comments on commit 2c1d694

Please sign in to comment.