nuxi generate

预渲染应用的每个路由,并将结果存储在纯 HTML 文件中。
Terminal
npx nuxi generate [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--preset] [--dotenv] [--envName]

generate 命令会预渲染应用的每个路由,并将结果存储在纯 HTML 文件中,你可以将其部署到任何静态托管服务上。该命令触发 nuxi build 命令,并将 prerender 参数设置为 true

¥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

参数

¥Arguments

参数描述
ROOTDIR="."指定工作目录(默认值:.

选项

¥Options

选项默认描述
--cwd=<directory>指定工作目录,该目录优先于 ROOTDIR(默认值:.
--logLevel=<silent|info|verbose>指定构建时日志级别
--presetNitro 服务器预设
--dotenv要加载的 .env 文件的路径,相对于根目录
--envName解析配置覆盖时使用的环境(构建时默认为 production,运行开发服务器时默认为 development

:

Read more in Docs > Getting Started > Deployment#static Hosting.

了解更多关于预渲染和静态托管的信息。

¥Read more about pre-rendering and static hosting.

::