nuxt analyze

Source
Analyze the production bundle or your Nuxt application.
Terminal
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

ArgumentDescription
ROOTDIRThe root directory of your Nuxt project (default: .)

Options

OptionDefaultDescription
--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>defaultName of the analysis
--servetrueServe the analysis results
--no-serveSkip serving the analysis results
--prerenderfalsePrerender routes while analyzing
This command sets process.env.NODE_ENV to production.