diff --git a/docs/content/1.docs/3.api/5.commands/generate.md b/docs/content/1.docs/3.api/5.commands/generate.md index 4965034a33..596dbc7262 100644 --- a/docs/content/1.docs/3.api/5.commands/generate.md +++ b/docs/content/1.docs/3.api/5.commands/generate.md @@ -6,7 +6,7 @@ description: Pre-renders every route of the application and stores the result in # `nuxi generate` ```{bash} -npx nuxi generate [rootDir] +npx nuxi generate [rootDir] [--dotenv] ``` The `generate` command pre-renders every route of your application and stores the result in plain HTML files that you can deploy on any static hosting services. The command triggers the `nuxi build` command with the `prerender` argument set to `true` @@ -14,3 +14,4 @@ The `generate` command pre-renders every route of your application and stores th Option | Default | Description -------------------------|-----------------|------------------ `rootDir` | `.` | The root directory of the application to generate +`--dotenv` | `.` | Point to another `.env` file to load, **relative** to the root directory. diff --git a/packages/nuxi/src/commands/generate.ts b/packages/nuxi/src/commands/generate.ts index 231103cd3c..cb344e878a 100644 --- a/packages/nuxi/src/commands/generate.ts +++ b/packages/nuxi/src/commands/generate.ts @@ -4,7 +4,7 @@ import { defineNuxtCommand } from './index' export default defineNuxtCommand({ meta: { name: 'generate', - usage: 'npx nuxi generate [rootDir]', + usage: 'npx nuxi generate [rootDir] [--dotenv]', description: 'Build Nuxt and prerender static routes' }, async invoke (args) {