cli/docs/analyze.md at main · nuxt/cli · GitHub
Skip to content

Latest commit

 

History

History
46 lines (38 loc) · 2.89 KB

analyze.md

File metadata and controls

46 lines (38 loc) · 2.89 KB
title nuxt analyze
description Analyze the production bundle or your Nuxt application.
links
label icon to size
Source
i-simple-icons-github
xs
npx nuxt analyze [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--dotenv=<path>...] [-e, --extends=<layer-name>...] [--name=<name>] [--serve] [--prerender]

The analyze command builds Nuxt and analyzes the production bundle (experimental). The results are served on a local server when the build finishes, unless you pass --no-serve or CI is set in the environment.

Routes are not prerendered while analyzing, since prerendering runs the built app and its output is not what is being measured. Pass --prerender if your analysis needs it.

Arguments

Argument Description
ROOTDIR The root directory of your Nuxt project (default: .)

Options

Option Default Description
--cwd=<directory> Specify the root directory of your Nuxt project
--logLevel=<silent|info|verbose> Specify build-time log level
--dotenv=<path>... Path to .env file to load, relative to the root directory. Can be repeated, with later files taking precedence.
-e, --extends=<layer-name>... Extend from a Nuxt layer
--name=<name> default Name of the analysis
--serve true Serve the analysis results
--no-serve Skip serving the analysis results
--prerender false Prerender routes while analyzing

::note This command sets process.env.NODE_ENV to production. ::