Skip to content
Open
Changes from all 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
43 changes: 21 additions & 22 deletions content/deploy/clever-cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,69 +22,68 @@ To deploy your Nuxt project to Clever Cloud, you will need to create a **new app
7. Inject **environment variables**:
- For **Node.js**

::package-managers
::code-group{sync="pm"}

```ini [npm]
CC_PRE_BUILD_HOOK="npm run build"
CC_POST_BUILD_HOOK="npm run build"
CC_RUN_COMMAND="node .output/server/index.mjs"
```

```ini [yarn]
CC_NODE_BUILD_TOOL="yarn"
CC_PRE_BUILD_HOOK="yarn install --frozen-lockfile && yarn build"
CC_POST_BUILD_HOOK="yarn build"
CC_RUN_COMMAND="node .output/server/index.mjs"
```

```ini [pnpm]
CC_CUSTOM_BUILD_TOOL="pnpm build"
CC_NODE_BUILD_TOOL="custom"
CC_PRE_BUILD_HOOK="npm i -g pnpm && pnpm install --frozen-lockfile && pnpm run build"
CC_POST_BUILD_HOOK="pnpm build"
CC_RUN_COMMAND="node .output/server/index.mjs"
```

```ini [bun]
CC_CUSTOM_BUILD_TOOL="bun build"
CC_NODE_BUILD_TOOL="custom"
CC_PRE_BUILD_HOOK="npm i -g bun && bun install && bun run build "
CC_POST_BUILD_HOOK="bun build"
CC_RUN_COMMAND="node .output/server/index.mjs"
```

::

- For a **static application**

::package-managers
::note
If [`ssr: false` is set in `nuxt.config.ts`](https://nuxt.com/docs/4.x/getting-started/deployment#static-hosting) **or** if your project contains dynamic routes that cannot be pre-rendered, you should :
1. Use a **Static Apache** application
2. Create a [`.htaccess`](https://www.clever.cloud/developers/doc/applications/static-apache/#serving-indexhtml-for-spa-single-page-application-routers) file that redirects all routes to `index.html` to ensure proper routing for your SPA.

Otherwise, you can use the default **Static HTML** application.
::

::code-group{sync="pm"}

```ini [npm]
CC_NODE_VERSION=20
CC_WEBROOT=/.output/public
CC_OVERRIDE_BUILDCACHE=/.output/public
CC_PRE_BUILD_HOOK=npm install
CC_POST_BUILD_HOOK=npx nuxi generate
CC_POST_BUILD_HOOK=npm run generate
```

```ini [yarn]
CC_NODE_VERSION=20
CC_WEBROOT=/.output/public
CC_OVERRIDE_BUILDCACHE=/.output/public
CC_PRE_BUILD_HOOK="yarn install --frozen-lockfile"
CC_POST_BUILD_HOOK=npx nuxi generate
CC_PRE_BUILD_HOOK=yarn install
CC_POST_BUILD_HOOK=yarn generate
```

```ini [pnpm]
CC_NODE_VERSION=20
CC_WEBROOT=/.output/public
CC_OVERRIDE_BUILDCACHE=/.output/public
CC_PRE_BUILD_HOOK="npm i -g pnpm && pnpm install --frozen-lockfile"
CC_POST_BUILD_HOOK=npx nuxi generate
CC_PRE_BUILD_HOOK=pnpm install
CC_POST_BUILD_HOOK=pnpm generate
```

```ini [bun]
CC_NODE_VERSION=20
CC_WEBROOT=/.output/public
CC_OVERRIDE_BUILDCACHE=/.output/public
CC_PRE_BUILD_HOOK="npm i -g bun && bun install"
CC_POST_BUILD_HOOK=npx nuxi generate
CC_PRE_BUILD_HOOK=bun install
CC_POST_BUILD_HOOK=bun generate
```

::
Expand Down