-
-
Notifications
You must be signed in to change notification settings - Fork 635
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
1 parent
56a234c
commit 2c1d694
Showing
6 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
:: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
icon: heroicons-outline:book-open |
File renamed without changes.
File renamed without changes.
File renamed without changes.