@nuxt/docs-nightly 4.5.1-29752449.30d24817 → 4.5.2-2610052030-052d82e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/1.getting-started/01.introduction.md +8 -8
- package/1.getting-started/02.installation.md +2 -4
- package/1.getting-started/03.configuration.md +16 -16
- package/1.getting-started/04.views.md +8 -8
- package/1.getting-started/05.assets.md +10 -10
- package/1.getting-started/06.styling.md +10 -10
- package/1.getting-started/07.routing.md +15 -15
- package/1.getting-started/08.seo-meta.md +15 -15
- package/1.getting-started/09.transitions.md +10 -10
- package/1.getting-started/10.data-fetching.md +61 -47
- package/1.getting-started/11.state-management.md +11 -11
- package/1.getting-started/12.error-handling.md +20 -18
- package/1.getting-started/13.server.md +7 -7
- package/1.getting-started/14.layers.md +6 -6
- package/1.getting-started/15.prerendering.md +22 -28
- package/1.getting-started/16.deployment.md +22 -6
- package/1.getting-started/17.testing.md +200 -21
- package/1.getting-started/18.upgrade.md +78 -278
- package/2.directory-structure/0.nuxt.md +2 -2
- package/2.directory-structure/0.output.md +3 -3
- package/2.directory-structure/1.app/1.assets.md +3 -3
- package/2.directory-structure/1.app/1.components.md +26 -109
- package/2.directory-structure/1.app/1.composables.md +5 -5
- package/2.directory-structure/1.app/1.layouts.md +10 -10
- package/2.directory-structure/1.app/1.middleware.md +14 -10
- package/2.directory-structure/1.app/1.pages.md +25 -20
- package/2.directory-structure/1.app/1.plugins.md +7 -7
- package/2.directory-structure/1.app/1.utils.md +9 -5
- package/2.directory-structure/1.app/3.app-config.md +7 -7
- package/2.directory-structure/1.app/3.app.md +6 -6
- package/2.directory-structure/1.app/3.error.md +1 -1
- package/2.directory-structure/1.content.md +1 -1
- package/2.directory-structure/1.layers.md +13 -13
- package/2.directory-structure/1.modules.md +3 -3
- package/2.directory-structure/1.node_modules.md +1 -1
- package/2.directory-structure/1.server.md +33 -14
- package/2.directory-structure/1.shared.md +7 -5
- package/2.directory-structure/1.test.md +25 -0
- package/2.directory-structure/2.env.md +7 -7
- package/2.directory-structure/2.nuxtignore.md +3 -3
- package/2.directory-structure/2.nuxtrc.md +3 -3
- package/2.directory-structure/3.nuxt-config.md +2 -2
- package/2.directory-structure/3.tsconfig.md +21 -11
- package/2.directory-structure/index.md +29 -25
- package/3.guide/0.index.md +6 -6
- package/3.guide/1.concepts/1.rendering.md +76 -12
- package/3.guide/1.concepts/10.vuejs-development.md +73 -8
- package/3.guide/1.concepts/2.nuxt-lifecycle.md +18 -18
- package/3.guide/1.concepts/3.auto-imports.md +11 -11
- package/3.guide/1.concepts/4.server-engine.md +6 -6
- package/3.guide/1.concepts/5.modules.md +4 -4
- package/3.guide/1.concepts/6.server-components.md +198 -0
- package/3.guide/1.concepts/7.esm.md +5 -5
- package/3.guide/1.concepts/8.typescript.md +9 -9
- package/3.guide/2.best-practices/accessibility.md +155 -0
- package/3.guide/2.best-practices/hydration.md +5 -5
- package/3.guide/2.best-practices/performance.md +13 -9
- package/3.guide/3.ai/1.mcp.md +104 -19
- package/3.guide/4.modules/2.module-anatomy.md +5 -5
- package/3.guide/4.modules/3.recipes-basics.md +8 -8
- package/3.guide/4.modules/4.module-dependencies.md +1 -1
- package/3.guide/4.modules/5.recipes-advanced.md +6 -8
- package/3.guide/4.modules/6.testing.md +2 -2
- package/3.guide/4.modules/7.best-practices.md +2 -2
- package/3.guide/4.modules/9.server-compatibility.md +215 -0
- package/3.guide/4.modules/index.md +9 -9
- package/3.guide/5.recipes/1.custom-routing.md +15 -11
- package/3.guide/5.recipes/2.vite-plugin.md +3 -3
- package/3.guide/5.recipes/3.custom-usefetch.md +5 -5
- package/3.guide/5.recipes/4.sessions-and-authentication.md +2 -2
- package/3.guide/5.recipes/5.mostly-static-sites.md +127 -0
- package/3.guide/6.going-further/1.events.md +1 -1
- package/3.guide/6.going-further/1.experimental-features.md +254 -22
- package/3.guide/6.going-further/1.features.md +42 -6
- package/3.guide/6.going-further/1.internals.md +10 -10
- package/3.guide/6.going-further/10.runtime-config.md +28 -6
- package/3.guide/6.going-further/11.nightly-release-channel.md +1 -1
- package/3.guide/6.going-further/2.hooks.md +6 -6
- package/3.guide/6.going-further/4.kit.md +4 -4
- package/3.guide/6.going-further/5.server-imports.md +221 -0
- package/3.guide/6.going-further/6.nuxt-app.md +7 -7
- package/3.guide/6.going-further/7.layers.md +13 -13
- package/3.guide/6.going-further/8.builders.md +38 -14
- package/4.api/1.components/1.nuxt-client-fallback.md +1 -1
- package/4.api/1.components/10.nuxt-picture.md +1 -1
- package/4.api/1.components/11.teleports.md +1 -1
- package/4.api/1.components/12.nuxt-route-announcer.md +5 -3
- package/4.api/1.components/14.nuxt-announcer.md +3 -3
- package/4.api/1.components/2.nuxt-page.md +5 -5
- package/4.api/1.components/3.nuxt-layout.md +8 -8
- package/4.api/1.components/4.nuxt-link.md +6 -4
- package/4.api/1.components/5.nuxt-loading-indicator.md +3 -3
- package/4.api/1.components/6.nuxt-error-boundary.md +1 -1
- package/4.api/1.components/8.nuxt-island.md +5 -5
- package/4.api/2.composables/create-use-async-data.md +51 -8
- package/4.api/2.composables/create-use-fetch.md +126 -9
- package/4.api/2.composables/use-announcer.md +3 -3
- package/4.api/2.composables/use-app-config.md +1 -1
- package/4.api/2.composables/use-async-data.md +19 -11
- package/4.api/2.composables/use-cookie.md +22 -6
- package/4.api/2.composables/use-error.md +1 -1
- package/4.api/2.composables/use-fetch.md +14 -10
- package/4.api/2.composables/use-head-safe.md +2 -2
- package/4.api/2.composables/use-head.md +2 -2
- package/4.api/2.composables/use-hydration.md +1 -1
- package/4.api/2.composables/use-layout.md +1 -1
- package/4.api/2.composables/use-lazy-async-data.md +8 -8
- package/4.api/2.composables/use-lazy-fetch.md +11 -11
- package/4.api/2.composables/use-loading-indicator.md +2 -2
- package/4.api/2.composables/use-nuxt-app.md +13 -13
- package/4.api/2.composables/use-nuxt-data.md +1 -1
- package/4.api/2.composables/use-preview-mode.md +3 -3
- package/4.api/2.composables/use-request-event.md +29 -3
- package/4.api/2.composables/use-request-fetch.md +2 -2
- package/4.api/2.composables/use-request-header.md +1 -1
- package/4.api/2.composables/use-request-headers.md +1 -1
- package/4.api/2.composables/use-request-url.md +1 -1
- package/4.api/2.composables/use-response-header.md +2 -2
- package/4.api/2.composables/use-route-announcer.md +4 -2
- package/4.api/2.composables/use-route.md +2 -2
- package/4.api/2.composables/use-router.md +5 -5
- package/4.api/2.composables/use-runtime-config.md +5 -5
- package/4.api/2.composables/use-runtime-hook.md +1 -1
- package/4.api/2.composables/use-seo-meta.md +3 -3
- package/4.api/2.composables/use-server-seo-meta.md +5 -5
- package/4.api/2.composables/use-state.md +4 -4
- package/4.api/3.utils/$fetch.md +5 -5
- package/4.api/3.utils/abort-navigation.md +1 -1
- package/4.api/3.utils/add-route-middleware.md +2 -2
- package/4.api/3.utils/call-once.md +3 -3
- package/4.api/3.utils/clear-error.md +2 -2
- package/4.api/3.utils/clear-nuxt-data.md +1 -1
- package/4.api/3.utils/clear-nuxt-state.md +2 -2
- package/4.api/3.utils/create-error.md +19 -1
- package/4.api/3.utils/define-nuxt-plugin.md +2 -2
- package/4.api/3.utils/define-nuxt-route-middleware.md +3 -3
- package/4.api/3.utils/define-page-meta.md +12 -12
- package/4.api/3.utils/define-route-rules.md +4 -4
- package/4.api/3.utils/define-use-async-data-addon.md +57 -0
- package/4.api/3.utils/define-use-fetch-addon.md +168 -0
- package/4.api/3.utils/navigate-to.md +6 -2
- package/4.api/3.utils/prefetch-components.md +1 -1
- package/4.api/3.utils/preload-route-components.md +2 -2
- package/4.api/3.utils/prerender-routes.md +3 -3
- package/4.api/3.utils/refresh-cookie.md +1 -1
- package/4.api/3.utils/refresh-nuxt-data.md +3 -3
- package/4.api/3.utils/reload-nuxt-app.md +1 -1
- package/4.api/3.utils/set-page-layout.md +1 -1
- package/4.api/3.utils/set-response-status.md +2 -2
- package/4.api/3.utils/show-error.md +3 -3
- package/4.api/3.utils/update-app-config.md +2 -2
- package/4.api/4.commands/README.md +9 -0
- package/4.api/5.kit/1.modules.md +3 -3
- package/4.api/5.kit/10.runtime-config.md +1 -1
- package/4.api/5.kit/10.templates.md +42 -0
- package/4.api/5.kit/12.nitro.md +59 -18
- package/4.api/5.kit/14.logging.md +56 -2
- package/4.api/5.kit/15.builder.md +1 -1
- package/4.api/5.kit/18.dependencies.md +90 -0
- package/4.api/5.kit/2.programmatic.md +78 -1
- package/4.api/5.kit/3.compatibility.md +2 -2
- package/4.api/5.kit/4.autoimports.md +13 -13
- package/4.api/5.kit/5.components.md +3 -3
- package/4.api/5.kit/6.context.md +2 -2
- package/4.api/5.kit/7.pages.md +35 -4
- package/4.api/5.kit/8.layout.md +1 -1
- package/4.api/6.advanced/1.hooks.md +6 -3
- package/4.api/6.nuxt-config.md +44 -21
- package/4.api/index.md +7 -7
- package/5.community/2.getting-help.md +1 -1
- package/5.community/3.reporting-bugs.md +1 -1
- package/5.community/4.contribution.md +14 -12
- package/5.community/5.framework-contribution.md +4 -4
- package/5.community/6.roadmap.md +6 -6
- package/6.bridge/1.overview.md +12 -12
- package/6.bridge/2.typescript.md +1 -1
- package/6.bridge/3.bridge-composition-api.md +6 -6
- package/6.bridge/4.plugins-and-middleware.md +4 -4
- package/6.bridge/5.nuxt3-compatible-api.md +9 -9
- package/6.bridge/6.meta.md +5 -5
- package/6.bridge/7.runtime-config.md +1 -1
- package/6.bridge/8.nitro.md +1 -1
- package/6.bridge/9.vite.md +1 -1
- package/7.migration/1.overview.md +2 -2
- package/7.migration/10.bundling.md +1 -1
- package/7.migration/11.server.md +3 -3
- package/7.migration/2.configuration.md +6 -6
- package/7.migration/20.module-authors.md +7 -7
- package/7.migration/3.auto-imports.md +3 -3
- package/7.migration/4.meta.md +4 -4
- package/7.migration/5.plugins-and-middleware.md +3 -3
- package/7.migration/6.pages-and-layouts.md +13 -13
- package/7.migration/7.component-options.md +15 -15
- package/7.migration/8.runtime-config.md +4 -4
- package/README.md +1 -1
- package/errors/e8007.md +28 -0
- package/package.json +2 -2
- package/4.api/4.commands/.navigation.yml +0 -3
- package/4.api/4.commands/add.md +0 -112
- package/4.api/4.commands/analyze.md +0 -42
- package/4.api/4.commands/build-module.md +0 -42
- package/4.api/4.commands/build.md +0 -48
- package/4.api/4.commands/cleanup.md +0 -38
- package/4.api/4.commands/dev.md +0 -61
- package/4.api/4.commands/devtools.md +0 -38
- package/4.api/4.commands/generate.md +0 -43
- package/4.api/4.commands/info.md +0 -33
- package/4.api/4.commands/init.md +0 -50
- package/4.api/4.commands/module.md +0 -84
- package/4.api/4.commands/prepare.md +0 -41
- package/4.api/4.commands/preview.md +0 -44
- package/4.api/4.commands/test.md +0 -40
- package/4.api/4.commands/typecheck.md +0 -44
- package/4.api/4.commands/upgrade.md +0 -37
package/4.api/4.commands/add.md
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "nuxt add"
|
|
3
|
-
description: "Scaffold an entity into your Nuxt application."
|
|
4
|
-
links:
|
|
5
|
-
- label: Source
|
|
6
|
-
icon: i-simple-icons-github
|
|
7
|
-
to: https://github.com/nuxt/cli/blob/main/packages/nuxi/src/commands/add-template.ts
|
|
8
|
-
size: xs
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
<!--add-cmd-->
|
|
12
|
-
```bash [Terminal]
|
|
13
|
-
npx nuxt add <TEMPLATE> <NAME> [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--force]
|
|
14
|
-
```
|
|
15
|
-
<!--/add-cmd-->
|
|
16
|
-
|
|
17
|
-
## Arguments
|
|
18
|
-
|
|
19
|
-
<!--add-args-->
|
|
20
|
-
| Argument | Description |
|
|
21
|
-
|------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
22
|
-
| `TEMPLATE` | Specify which template to generate (options: <api\|app\|app-config\|component\|composable\|error\|layer\|layout\|middleware\|module\|page\|plugin\|server-middleware\|server-plugin\|server-route\|server-util>) |
|
|
23
|
-
| `NAME` | Specify name of the generated file |
|
|
24
|
-
<!--/add-args-->
|
|
25
|
-
|
|
26
|
-
## Options
|
|
27
|
-
|
|
28
|
-
<!--add-opts-->
|
|
29
|
-
| Option | Default | Description |
|
|
30
|
-
|--------------------------------------|---------|------------------------------------------|
|
|
31
|
-
| `--cwd=<directory>` | `.` | Specify the working directory |
|
|
32
|
-
| `--logLevel=<silent\|info\|verbose>` | | Specify build-time log level |
|
|
33
|
-
| `--force` | `false` | Force override file if it already exists |
|
|
34
|
-
<!--/add-opts-->
|
|
35
|
-
|
|
36
|
-
**Modifiers:**
|
|
37
|
-
|
|
38
|
-
Some templates support additional modifier flags to add a suffix (like `.client` or `.get`) to their name.
|
|
39
|
-
|
|
40
|
-
```bash [Terminal]
|
|
41
|
-
# Generates `/plugins/sockets.client.ts`
|
|
42
|
-
npx nuxt add plugin sockets --client
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## `nuxt add component`
|
|
46
|
-
|
|
47
|
-
* Modifier flags: `--mode client|server` or `--client` or `--server`
|
|
48
|
-
|
|
49
|
-
```bash [Terminal]
|
|
50
|
-
# Generates `app/components/TheHeader.vue`
|
|
51
|
-
npx nuxt add component TheHeader
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## `nuxt add composable`
|
|
55
|
-
|
|
56
|
-
```bash [Terminal]
|
|
57
|
-
# Generates `app/composables/foo.ts`
|
|
58
|
-
npx nuxt add composable foo
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## `nuxt add layout`
|
|
62
|
-
|
|
63
|
-
```bash [Terminal]
|
|
64
|
-
# Generates `app/layouts/custom.vue`
|
|
65
|
-
npx nuxt add layout custom
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## `nuxt add plugin`
|
|
69
|
-
|
|
70
|
-
* Modifier flags: `--mode client|server` or `--client`or `--server`
|
|
71
|
-
|
|
72
|
-
```bash [Terminal]
|
|
73
|
-
# Generates `app/plugins/analytics.ts`
|
|
74
|
-
npx nuxt add plugin analytics
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
## `nuxt add page`
|
|
78
|
-
|
|
79
|
-
```bash [Terminal]
|
|
80
|
-
# Generates `app/pages/about.vue`
|
|
81
|
-
npx nuxt add page about
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
```bash [Terminal]
|
|
85
|
-
# Generates `app/pages/category/[id].vue`
|
|
86
|
-
npx nuxt add page "category/[id]"
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
## `nuxt add middleware`
|
|
90
|
-
|
|
91
|
-
* Modifier flags: `--global`
|
|
92
|
-
|
|
93
|
-
```bash [Terminal]
|
|
94
|
-
# Generates `app/middleware/auth.ts`
|
|
95
|
-
npx nuxt add middleware auth
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
## `nuxt add api`
|
|
99
|
-
|
|
100
|
-
* Modifier flags: `--method` (can accept `connect`, `delete`, `get`, `head`, `options`, `patch`, `post`, `put` or `trace`) or alternatively you can directly use `--get`, `--post`, etc.
|
|
101
|
-
|
|
102
|
-
```bash [Terminal]
|
|
103
|
-
# Generates `server/api/hello.ts`
|
|
104
|
-
npx nuxt add api hello
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
## `nuxt add layer`
|
|
108
|
-
|
|
109
|
-
```bash [Terminal]
|
|
110
|
-
# Generates `layers/subscribe/nuxt.config.ts`
|
|
111
|
-
npx nuxt add layer subscribe
|
|
112
|
-
```
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "nuxt analyze"
|
|
3
|
-
description: "Analyze the production bundle or your Nuxt application."
|
|
4
|
-
links:
|
|
5
|
-
- label: Source
|
|
6
|
-
icon: i-simple-icons-github
|
|
7
|
-
to: https://github.com/nuxt/cli/blob/main/packages/nuxi/src/commands/analyze.ts
|
|
8
|
-
size: xs
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
<!--analyze-cmd-->
|
|
12
|
-
```bash [Terminal]
|
|
13
|
-
npx nuxt analyze [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--dotenv] [-e, --extends=<layer-name>] [--name=<name>] [--no-serve]
|
|
14
|
-
```
|
|
15
|
-
<!--/analyze-cmd-->
|
|
16
|
-
|
|
17
|
-
The `analyze` command builds Nuxt and analyzes the production bundle (experimental).
|
|
18
|
-
|
|
19
|
-
## Arguments
|
|
20
|
-
|
|
21
|
-
<!--analyze-args-->
|
|
22
|
-
| Argument | Description |
|
|
23
|
-
|---------------|------------------------------------------------|
|
|
24
|
-
| `ROOTDIR="."` | Specifies the working directory (default: `.`) |
|
|
25
|
-
<!--/analyze-args-->
|
|
26
|
-
|
|
27
|
-
## Options
|
|
28
|
-
|
|
29
|
-
<!--analyze-opts-->
|
|
30
|
-
| Option | Default | Description |
|
|
31
|
-
|--------------------------------------|-----------|----------------------------------------------------------------------------------|
|
|
32
|
-
| `--cwd=<directory>` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`) |
|
|
33
|
-
| `--logLevel=<silent\|info\|verbose>` | | Specify build-time log level |
|
|
34
|
-
| `--dotenv` | | Path to `.env` file to load, relative to the root directory |
|
|
35
|
-
| `-e, --extends=<layer-name>` | | Extend from a Nuxt layer |
|
|
36
|
-
| `--name=<name>` | `default` | Name of the analysis |
|
|
37
|
-
| `--no-serve` | | Skip serving the analysis results |
|
|
38
|
-
<!--/analyze-opts-->
|
|
39
|
-
|
|
40
|
-
::note
|
|
41
|
-
This command sets `process.env.NODE_ENV` to `production`.
|
|
42
|
-
::
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: 'nuxt build-module'
|
|
3
|
-
description: 'Nuxt command to build your Nuxt module before publishing.'
|
|
4
|
-
links:
|
|
5
|
-
- label: Source
|
|
6
|
-
icon: i-simple-icons-github
|
|
7
|
-
to: https://github.com/nuxt/module-builder/blob/main/src/cli.ts
|
|
8
|
-
size: xs
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
<!--build-module-cmd-->
|
|
12
|
-
```bash [Terminal]
|
|
13
|
-
npx nuxt build-module [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--build] [--stub] [--sourcemap] [--prepare]
|
|
14
|
-
```
|
|
15
|
-
<!--/build-module-cmd-->
|
|
16
|
-
|
|
17
|
-
The `build-module` command runs `@nuxt/module-builder` to generate `dist` directory within your `rootDir` that contains the full build for your **nuxt-module**.
|
|
18
|
-
|
|
19
|
-
## Arguments
|
|
20
|
-
|
|
21
|
-
<!--build-module-args-->
|
|
22
|
-
| Argument | Description |
|
|
23
|
-
|---------------|------------------------------------------------|
|
|
24
|
-
| `ROOTDIR="."` | Specifies the working directory (default: `.`) |
|
|
25
|
-
<!--/build-module-args-->
|
|
26
|
-
|
|
27
|
-
## Options
|
|
28
|
-
|
|
29
|
-
<!--build-module-opts-->
|
|
30
|
-
| Option | Default | Description |
|
|
31
|
-
|--------------------------------------|---------|----------------------------------------------------------------------------------|
|
|
32
|
-
| `--cwd=<directory>` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`) |
|
|
33
|
-
| `--logLevel=<silent\|info\|verbose>` | | Specify build-time log level |
|
|
34
|
-
| `--build` | `false` | Build module for distribution |
|
|
35
|
-
| `--stub` | `false` | Stub dist instead of actually building it for development |
|
|
36
|
-
| `--sourcemap` | `false` | Generate sourcemaps |
|
|
37
|
-
| `--prepare` | `false` | Prepare module for local development |
|
|
38
|
-
<!--/build-module-opts-->
|
|
39
|
-
|
|
40
|
-
::read-more{to="https://github.com/nuxt/module-builder" icon="i-simple-icons-github" target="\_blank"}
|
|
41
|
-
Read more about `@nuxt/module-builder`.
|
|
42
|
-
::
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "nuxt build"
|
|
3
|
-
description: "Build your Nuxt application."
|
|
4
|
-
links:
|
|
5
|
-
- label: Source
|
|
6
|
-
icon: i-simple-icons-github
|
|
7
|
-
to: https://github.com/nuxt/cli/blob/main/packages/nuxi/src/commands/build.ts
|
|
8
|
-
size: xs
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
<!--build-cmd-->
|
|
12
|
-
```bash [Terminal]
|
|
13
|
-
npx nuxt build [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--prerender] [--preset] [--dotenv] [--envName] [-e, --extends=<layer-name>] [--profile[=verbose]]
|
|
14
|
-
```
|
|
15
|
-
<!--/build-cmd-->
|
|
16
|
-
|
|
17
|
-
The `build` command creates a `.output` directory with all your application, server and dependencies ready for production.
|
|
18
|
-
|
|
19
|
-
## Arguments
|
|
20
|
-
|
|
21
|
-
<!--build-args-->
|
|
22
|
-
| Argument | Description |
|
|
23
|
-
|---------------|------------------------------------------------|
|
|
24
|
-
| `ROOTDIR="."` | Specifies the working directory (default: `.`) |
|
|
25
|
-
<!--/build-args-->
|
|
26
|
-
|
|
27
|
-
## Options
|
|
28
|
-
|
|
29
|
-
<!--build-opts-->
|
|
30
|
-
| Option | Default | Description |
|
|
31
|
-
|--------------------------------------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
32
|
-
| `--cwd=<directory>` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`) |
|
|
33
|
-
| `--logLevel=<silent\|info\|verbose>` | | Specify build-time log level |
|
|
34
|
-
| `--prerender` | | Build Nuxt and prerender static routes |
|
|
35
|
-
| `--preset=<preset>` | | Specify Nitro server preset. Available presets depend on Nitro (e.g. `node-server`, `vercel`, `netlify`, `static`) |
|
|
36
|
-
| `--dotenv` | | Path to `.env` file to load, relative to the root directory |
|
|
37
|
-
| `--envName` | | The environment to use when resolving configuration overrides (default is `production` when building, and `development` when running the dev server) |
|
|
38
|
-
| `-e, --extends=<layer-name>` | | Extend from a Nuxt layer |
|
|
39
|
-
| `--profile` :badge[v4.4]{color="info" size="xs" class="align-middle"} | | Profile performance. Writes a V8 CPU profile and JSON report on exit. Use `--profile=verbose` for a full console report. |
|
|
40
|
-
<!--/build-opts-->
|
|
41
|
-
|
|
42
|
-
::note
|
|
43
|
-
This command sets `process.env.NODE_ENV` to `production`.
|
|
44
|
-
::
|
|
45
|
-
|
|
46
|
-
::note
|
|
47
|
-
`--prerender` will always set the `preset` to `static`
|
|
48
|
-
::
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: 'nuxt cleanup'
|
|
3
|
-
description: 'Remove common generated Nuxt files and caches.'
|
|
4
|
-
links:
|
|
5
|
-
- label: Source
|
|
6
|
-
icon: i-simple-icons-github
|
|
7
|
-
to: https://github.com/nuxt/cli/blob/main/packages/nuxi/src/commands/cleanup.ts
|
|
8
|
-
size: xs
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
<!--cleanup-cmd-->
|
|
12
|
-
```bash [Terminal]
|
|
13
|
-
npx nuxt cleanup [ROOTDIR] [--cwd=<directory>]
|
|
14
|
-
```
|
|
15
|
-
<!--/cleanup-cmd-->
|
|
16
|
-
|
|
17
|
-
The `cleanup` command removes common generated Nuxt files and caches, including:
|
|
18
|
-
|
|
19
|
-
- `.nuxt`
|
|
20
|
-
- `.output`
|
|
21
|
-
- `node_modules/.vite`
|
|
22
|
-
- `node_modules/.cache`
|
|
23
|
-
|
|
24
|
-
## Arguments
|
|
25
|
-
|
|
26
|
-
<!--cleanup-args-->
|
|
27
|
-
| Argument | Description |
|
|
28
|
-
|---------------|------------------------------------------------|
|
|
29
|
-
| `ROOTDIR="."` | Specifies the working directory (default: `.`) |
|
|
30
|
-
<!--/cleanup-args-->
|
|
31
|
-
|
|
32
|
-
## Options
|
|
33
|
-
|
|
34
|
-
<!--cleanup-opts-->
|
|
35
|
-
| Option | Default | Description |
|
|
36
|
-
|---------------------|---------|----------------------------------------------------------------------------------|
|
|
37
|
-
| `--cwd=<directory>` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`) |
|
|
38
|
-
<!--/cleanup-opts-->
|
package/4.api/4.commands/dev.md
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: 'nuxt dev'
|
|
3
|
-
description: The dev command starts a development server with hot module replacement at http://localhost:3000
|
|
4
|
-
links:
|
|
5
|
-
- label: Source
|
|
6
|
-
icon: i-simple-icons-github
|
|
7
|
-
to: https://github.com/nuxt/cli/blob/main/packages/nuxi/src/commands/dev.ts
|
|
8
|
-
size: xs
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
<!--dev-cmd-->
|
|
12
|
-
```bash [Terminal]
|
|
13
|
-
npx nuxt dev [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--dotenv] [--envName] [-e, --extends=<layer-name>] [--clear] [--no-f, --no-fork] [-p, --port] [-h, --host] [--clipboard] [-o, --open] [--https] [--publicURL] [--qr] [--public] [--tunnel] [--profile[=verbose]] [--sslCert] [--sslKey]
|
|
14
|
-
```
|
|
15
|
-
<!--/dev-cmd-->
|
|
16
|
-
|
|
17
|
-
The `dev` command starts a development server with hot module replacement at [http://localhost:3000](https://localhost:3000)
|
|
18
|
-
|
|
19
|
-
## Arguments
|
|
20
|
-
|
|
21
|
-
<!--dev-args-->
|
|
22
|
-
| Argument | Description |
|
|
23
|
-
|---------------|------------------------------------------------|
|
|
24
|
-
| `ROOTDIR="."` | Specifies the working directory (default: `.`) |
|
|
25
|
-
<!--/dev-args-->
|
|
26
|
-
|
|
27
|
-
## Options
|
|
28
|
-
|
|
29
|
-
<!--dev-opts-->
|
|
30
|
-
| Option | Default | Description |
|
|
31
|
-
|--------------------------------------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
32
|
-
| `--cwd=<directory>` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`) |
|
|
33
|
-
| `--logLevel=<silent\|info\|verbose>` | | Specify build-time log level |
|
|
34
|
-
| `--dotenv` | | Path to `.env` file to load, relative to the root directory |
|
|
35
|
-
| `--envName` | | The environment to use when resolving configuration overrides (default is `production` when building, and `development` when running the dev server) |
|
|
36
|
-
| `-e, --extends=<layer-name>` | | Extend from a Nuxt layer |
|
|
37
|
-
| `--clear` | `false` | Clear console on restart |
|
|
38
|
-
| `--no-f, --no-fork` | | Disable forked mode |
|
|
39
|
-
| `-p, --port` | | Port to listen on (default: `NUXT_PORT \|\| NITRO_PORT \|\| PORT \|\| nuxtOptions.devServer.port`) |
|
|
40
|
-
| `-h, --host` | | Host to listen on (default: `NUXT_HOST \|\| NITRO_HOST \|\| HOST \|\| nuxtOptions.devServer?.host`) |
|
|
41
|
-
| `--clipboard` | `false` | Copy the URL to the clipboard |
|
|
42
|
-
| `-o, --open` | `false` | Open the URL in the browser |
|
|
43
|
-
| `--https` | | Enable HTTPS |
|
|
44
|
-
| `--publicURL` | | Displayed public URL (used for QR code) |
|
|
45
|
-
| `--qr` | | Display The QR code of public URL when available |
|
|
46
|
-
| `--public` | | Listen to all network interfaces |
|
|
47
|
-
| `--tunnel` | | Open a tunnel using https://github.com/unjs/untun |
|
|
48
|
-
| `--profile` :badge[v4.4]{color="info" size="xs" class="align-middle"} | | Profile performance. Writes a V8 CPU profile and JSON report on exit. Use `--profile=verbose` for a full console report. |
|
|
49
|
-
| `--sslCert` | | (DEPRECATED) Use `--https.cert` instead. |
|
|
50
|
-
| `--sslKey` | | (DEPRECATED) Use `--https.key` instead. |
|
|
51
|
-
<!--/dev-opts-->
|
|
52
|
-
|
|
53
|
-
The port and host can also be set via NUXT_PORT, PORT, NUXT_HOST or HOST environment variables.
|
|
54
|
-
|
|
55
|
-
Additionally to the above options, `@nuxt/cli` can pass options through to `listhen`, e.g. `--no-qr` to turn off the dev server QR code. You can find the list of `listhen` options in the [unjs/listhen](https://github.com/unjs/listhen) docs.
|
|
56
|
-
|
|
57
|
-
This command sets `process.env.NODE_ENV` to `development`.
|
|
58
|
-
|
|
59
|
-
::note
|
|
60
|
-
If you are using a self-signed certificate in development, you will need to set `NODE_TLS_REJECT_UNAUTHORIZED=0` in your environment.
|
|
61
|
-
::
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "nuxt devtools"
|
|
3
|
-
description: The devtools command allows you to enable or disable Nuxt DevTools on a per-project basis.
|
|
4
|
-
links:
|
|
5
|
-
- label: Source
|
|
6
|
-
icon: i-simple-icons-github
|
|
7
|
-
to: https://github.com/nuxt/cli/blob/main/packages/nuxi/src/commands/devtools.ts
|
|
8
|
-
size: xs
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
<!--devtools-cmd-->
|
|
12
|
-
```bash [Terminal]
|
|
13
|
-
npx nuxt devtools <COMMAND> [ROOTDIR] [--cwd=<directory>]
|
|
14
|
-
```
|
|
15
|
-
<!--/devtools-cmd-->
|
|
16
|
-
|
|
17
|
-
Running `nuxt devtools enable` will install the Nuxt DevTools globally, and also enable it within the particular project you are using. It is saved as a preference in your user-level `.nuxtrc`. If you want to remove devtools support for a particular project, you can run `nuxt devtools disable`.
|
|
18
|
-
|
|
19
|
-
## Arguments
|
|
20
|
-
|
|
21
|
-
<!--devtools-args-->
|
|
22
|
-
| Argument | Description |
|
|
23
|
-
|---------------|------------------------------------------------|
|
|
24
|
-
| `COMMAND` | Command to run (options: <enable\|disable>) |
|
|
25
|
-
| `ROOTDIR="."` | Specifies the working directory (default: `.`) |
|
|
26
|
-
<!--/devtools-args-->
|
|
27
|
-
|
|
28
|
-
## Options
|
|
29
|
-
|
|
30
|
-
<!--devtools-opts-->
|
|
31
|
-
| Option | Default | Description |
|
|
32
|
-
|---------------------|---------|----------------------------------------------------------------------------------|
|
|
33
|
-
| `--cwd=<directory>` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`) |
|
|
34
|
-
<!--/devtools-opts-->
|
|
35
|
-
|
|
36
|
-
::read-more{icon="i-simple-icons-nuxtdotjs" to="https://devtools.nuxt.com" target="\_blank"}
|
|
37
|
-
Read more about the **Nuxt DevTools**.
|
|
38
|
-
::
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "nuxt generate"
|
|
3
|
-
description: Pre-renders every route of the application and stores the result in plain HTML files.
|
|
4
|
-
links:
|
|
5
|
-
- label: Source
|
|
6
|
-
icon: i-simple-icons-github
|
|
7
|
-
to: https://github.com/nuxt/cli/blob/main/packages/nuxi/src/commands/generate.ts
|
|
8
|
-
size: xs
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
<!--generate-cmd-->
|
|
12
|
-
```bash [Terminal]
|
|
13
|
-
npx nuxt generate [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--preset] [--dotenv] [--envName] [-e, --extends=<layer-name>] [--profile[=verbose]]
|
|
14
|
-
```
|
|
15
|
-
<!--/generate-cmd-->
|
|
16
|
-
|
|
17
|
-
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 `nuxt build` command with the `prerender` argument set to `true`
|
|
18
|
-
|
|
19
|
-
## Arguments
|
|
20
|
-
|
|
21
|
-
<!--generate-args-->
|
|
22
|
-
| Argument | Description |
|
|
23
|
-
|---------------|------------------------------------------------|
|
|
24
|
-
| `ROOTDIR="."` | Specifies the working directory (default: `.`) |
|
|
25
|
-
<!--/generate-args-->
|
|
26
|
-
|
|
27
|
-
## Options
|
|
28
|
-
|
|
29
|
-
<!--generate-opts-->
|
|
30
|
-
| Option | Default | Description |
|
|
31
|
-
|--------------------------------------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
32
|
-
| `--cwd=<directory>` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`) |
|
|
33
|
-
| `--logLevel=<silent\|info\|verbose>` | | Specify build-time log level |
|
|
34
|
-
| `--preset` | | Nitro server preset |
|
|
35
|
-
| `--dotenv` | | Path to `.env` file to load, relative to the root directory |
|
|
36
|
-
| `--envName` | | The environment to use when resolving configuration overrides (default is `production` when building, and `development` when running the dev server) |
|
|
37
|
-
| `-e, --extends=<layer-name>` | | Extend from a Nuxt layer |
|
|
38
|
-
| `--profile` :badge[v4.4]{color="info" size="xs" class="align-middle"} | | Profile performance. Writes a V8 CPU profile and JSON report on exit. Use `--profile=verbose` for a full console report. |
|
|
39
|
-
<!--/generate-opts-->
|
|
40
|
-
|
|
41
|
-
::read-more{to="/docs/4.x/getting-started/deployment#static-hosting"}
|
|
42
|
-
Read more about pre-rendering and static hosting.
|
|
43
|
-
::
|
package/4.api/4.commands/info.md
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "nuxt info"
|
|
3
|
-
description: The info command logs information about the current or specified Nuxt project.
|
|
4
|
-
links:
|
|
5
|
-
- label: Source
|
|
6
|
-
icon: i-simple-icons-github
|
|
7
|
-
to: https://github.com/nuxt/cli/blob/main/packages/nuxi/src/commands/info.ts
|
|
8
|
-
size: xs
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
<!--info-cmd-->
|
|
12
|
-
```bash [Terminal]
|
|
13
|
-
npx nuxt info [ROOTDIR] [--cwd=<directory>]
|
|
14
|
-
```
|
|
15
|
-
<!--/info-cmd-->
|
|
16
|
-
|
|
17
|
-
The `info` command logs information about the current or specified Nuxt project.
|
|
18
|
-
|
|
19
|
-
## Arguments
|
|
20
|
-
|
|
21
|
-
<!--info-args-->
|
|
22
|
-
| Argument | Description |
|
|
23
|
-
|---------------|------------------------------------------------|
|
|
24
|
-
| `ROOTDIR="."` | Specifies the working directory (default: `.`) |
|
|
25
|
-
<!--/info-args-->
|
|
26
|
-
|
|
27
|
-
## Options
|
|
28
|
-
|
|
29
|
-
<!--info-opts-->
|
|
30
|
-
| Option | Default | Description |
|
|
31
|
-
|---------------------|---------|----------------------------------------------------------------------------------|
|
|
32
|
-
| `--cwd=<directory>` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`) |
|
|
33
|
-
<!--/info-opts-->
|
package/4.api/4.commands/init.md
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "create nuxt"
|
|
3
|
-
description: The init command initializes a fresh Nuxt project.
|
|
4
|
-
links:
|
|
5
|
-
- label: Source
|
|
6
|
-
icon: i-simple-icons-github
|
|
7
|
-
to: https://github.com/nuxt/cli/blob/main/packages/nuxi/src/commands/init.ts
|
|
8
|
-
size: xs
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
<!--init-cmd-->
|
|
12
|
-
```bash [Terminal]
|
|
13
|
-
npm create nuxt@latest [DIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [-t, --template] [-f, --force] [--offline] [--preferOffline] [--no-install] [--gitInit] [--shell] [--packageManager] [-M, --modules] [--no-modules] [--nightly]
|
|
14
|
-
```
|
|
15
|
-
<!--/init-cmd-->
|
|
16
|
-
|
|
17
|
-
The `create-nuxt` command initializes a fresh Nuxt project using [unjs/giget](https://github.com/unjs/giget).
|
|
18
|
-
|
|
19
|
-
## Arguments
|
|
20
|
-
|
|
21
|
-
<!--init-args-->
|
|
22
|
-
| Argument | Description |
|
|
23
|
-
|----------|-------------------|
|
|
24
|
-
| `DIR=""` | Project directory |
|
|
25
|
-
<!--/init-args-->
|
|
26
|
-
|
|
27
|
-
## Options
|
|
28
|
-
|
|
29
|
-
<!--init-opts-->
|
|
30
|
-
| Option | Default | Description |
|
|
31
|
-
|--------------------------------------|---------|----------------------------------------------------------|
|
|
32
|
-
| `--cwd=<directory>` | `.` | Specify the working directory |
|
|
33
|
-
| `--logLevel=<silent\|info\|verbose>` | | Specify build-time log level |
|
|
34
|
-
| `-t, --template` | | Template name |
|
|
35
|
-
| `-f, --force` | | Override existing directory |
|
|
36
|
-
| `--offline` | | Force offline mode |
|
|
37
|
-
| `--preferOffline` | | Prefer offline mode |
|
|
38
|
-
| `--no-install` | | Skip installing dependencies |
|
|
39
|
-
| `--gitInit` | | Initialize git repository |
|
|
40
|
-
| `--shell` | | Start shell after installation in project directory |
|
|
41
|
-
| `--packageManager` | | Package manager choice (npm, pnpm, yarn, bun) |
|
|
42
|
-
| `-M, --modules` | | Nuxt modules to install (comma separated without spaces) |
|
|
43
|
-
| `--no-modules` | | Skip module installation prompt |
|
|
44
|
-
| `--nightly` | | Use Nuxt nightly release channel (3x or latest) |
|
|
45
|
-
<!--/init-opts-->
|
|
46
|
-
|
|
47
|
-
## Environment Variables
|
|
48
|
-
|
|
49
|
-
- `NUXI_INIT_REGISTRY`: Set to a custom template registry. ([learn more](https://github.com/unjs/giget#custom-registry)).
|
|
50
|
-
- Default registry is loaded from [nuxt/starter/templates](https://github.com/nuxt/starter/tree/templates/templates)
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "nuxt module"
|
|
3
|
-
description: "Search and add modules to your Nuxt application with the command line."
|
|
4
|
-
links:
|
|
5
|
-
- label: Source
|
|
6
|
-
icon: i-simple-icons-github
|
|
7
|
-
to: https://github.com/nuxt/cli/tree/main/packages/nuxi/src/commands/module
|
|
8
|
-
size: xs
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
Nuxt provides a few utilities to work with [Nuxt modules](/modules) seamlessly.
|
|
12
|
-
|
|
13
|
-
## `nuxt module add`
|
|
14
|
-
|
|
15
|
-
<!--module-add-cmd-->
|
|
16
|
-
```bash [Terminal]
|
|
17
|
-
npx nuxt module add <MODULENAME> [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--skipInstall] [--skipConfig] [--dev]
|
|
18
|
-
```
|
|
19
|
-
<!--/module-add-cmd-->
|
|
20
|
-
|
|
21
|
-
<!--module-add-args-->
|
|
22
|
-
| Argument | Description |
|
|
23
|
-
|--------------|---------------------------------------------------------------------|
|
|
24
|
-
| `MODULENAME` | Specify one or more modules to install by name, separated by spaces |
|
|
25
|
-
<!--/module-add-args-->
|
|
26
|
-
|
|
27
|
-
<!--module-add-opts-->
|
|
28
|
-
| Option | Default | Description |
|
|
29
|
-
|--------------------------------------|---------|-------------------------------------|
|
|
30
|
-
| `--cwd=<directory>` | `.` | Specify the working directory |
|
|
31
|
-
| `--logLevel=<silent\|info\|verbose>` | | Specify build-time log level |
|
|
32
|
-
| `--skipInstall` | | Skip npm install |
|
|
33
|
-
| `--skipConfig` | | Skip nuxt.config.ts update |
|
|
34
|
-
| `--dev` | | Install modules as dev dependencies |
|
|
35
|
-
<!--/module-add-opts-->
|
|
36
|
-
|
|
37
|
-
The command lets you install [Nuxt modules](/modules) in your application with no manual work.
|
|
38
|
-
|
|
39
|
-
When running the command, it will:
|
|
40
|
-
|
|
41
|
-
- install the module as a dependency using your package manager
|
|
42
|
-
- add it to your [package.json](/docs/4.x/directory-structure/package) file
|
|
43
|
-
- update your [`nuxt.config`](/docs/4.x/directory-structure/nuxt-config) file
|
|
44
|
-
|
|
45
|
-
**Example:**
|
|
46
|
-
|
|
47
|
-
Installing the [`Pinia`](/modules/pinia) module
|
|
48
|
-
|
|
49
|
-
```bash [Terminal]
|
|
50
|
-
npx nuxt module add pinia
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## `nuxt module search`
|
|
54
|
-
|
|
55
|
-
<!--module-search-cmd-->
|
|
56
|
-
```bash [Terminal]
|
|
57
|
-
npx nuxt module search <QUERY> [--cwd=<directory>] [--nuxtVersion=<2|3>]
|
|
58
|
-
```
|
|
59
|
-
<!--/module-search-cmd-->
|
|
60
|
-
|
|
61
|
-
### Arguments
|
|
62
|
-
|
|
63
|
-
<!--module-search-args-->
|
|
64
|
-
| Argument | Description |
|
|
65
|
-
|----------|------------------------|
|
|
66
|
-
| `QUERY` | keywords to search for |
|
|
67
|
-
<!--/module-search-args-->
|
|
68
|
-
|
|
69
|
-
### Options
|
|
70
|
-
|
|
71
|
-
<!--module-search-opts-->
|
|
72
|
-
| Option | Default | Description |
|
|
73
|
-
|------------------------|---------|------------------------------------------------------------------------------------|
|
|
74
|
-
| `--cwd=<directory>` | `.` | Specify the working directory |
|
|
75
|
-
| `--nuxtVersion=<2\|3>` | | Filter by Nuxt version and list compatible modules only (auto detected by default) |
|
|
76
|
-
<!--/module-search-opts-->
|
|
77
|
-
|
|
78
|
-
The command searches for Nuxt modules matching your query that are compatible with your Nuxt version.
|
|
79
|
-
|
|
80
|
-
**Example:**
|
|
81
|
-
|
|
82
|
-
```bash [Terminal]
|
|
83
|
-
npx nuxt module search pinia
|
|
84
|
-
```
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: 'nuxt prepare'
|
|
3
|
-
description: The prepare command creates a .nuxt directory in your application and generates types.
|
|
4
|
-
links:
|
|
5
|
-
- label: Source
|
|
6
|
-
icon: i-simple-icons-github
|
|
7
|
-
to: https://github.com/nuxt/cli/blob/main/packages/nuxi/src/commands/prepare.ts
|
|
8
|
-
size: xs
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
<!--prepare-cmd-->
|
|
12
|
-
```bash [Terminal]
|
|
13
|
-
npx nuxt prepare [ROOTDIR] [--dotenv] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--envName] [-e, --extends=<layer-name>]
|
|
14
|
-
```
|
|
15
|
-
<!--/prepare-cmd-->
|
|
16
|
-
|
|
17
|
-
The `prepare` command creates a [`.nuxt`](/docs/4.x/directory-structure/nuxt) directory in your application and generates types. This can be useful in a CI environment or as a `postinstall` command in your [`package.json`](/docs/4.x/directory-structure/package).
|
|
18
|
-
|
|
19
|
-
## Arguments
|
|
20
|
-
|
|
21
|
-
<!--prepare-args-->
|
|
22
|
-
| Argument | Description |
|
|
23
|
-
|---------------|------------------------------------------------|
|
|
24
|
-
| `ROOTDIR="."` | Specifies the working directory (default: `.`) |
|
|
25
|
-
<!--/prepare-args-->
|
|
26
|
-
|
|
27
|
-
## Options
|
|
28
|
-
|
|
29
|
-
<!--prepare-opts-->
|
|
30
|
-
| Option | Default | Description |
|
|
31
|
-
|--------------------------------------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
32
|
-
| `--dotenv` | | Path to `.env` file to load, relative to the root directory |
|
|
33
|
-
| `--cwd=<directory>` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`) |
|
|
34
|
-
| `--logLevel=<silent\|info\|verbose>` | | Specify build-time log level |
|
|
35
|
-
| `--envName` | | The environment to use when resolving configuration overrides (default is `production` when building, and `development` when running the dev server) |
|
|
36
|
-
| `-e, --extends=<layer-name>` | | Extend from a Nuxt layer |
|
|
37
|
-
<!--/prepare-opts-->
|
|
38
|
-
|
|
39
|
-
::note
|
|
40
|
-
This command sets `process.env.NODE_ENV` to `production`.
|
|
41
|
-
::
|