mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-25 10:08:29 +00:00
docs: add .nuxtrc
documentation (#31093)
This commit is contained in:
parent
4c9b636990
commit
05a9ff64e7
50
docs/2.guide/2.directory-structure/2.nuxtrc.md
Normal file
50
docs/2.guide/2.directory-structure/2.nuxtrc.md
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
---
|
||||||
|
title: ".nuxtrc"
|
||||||
|
description: "The .nuxtrc file allows you to define nuxt configurations in a flat syntax."
|
||||||
|
head.title: ".nuxtrc"
|
||||||
|
navigation.icon: i-ph-file
|
||||||
|
---
|
||||||
|
|
||||||
|
The `.nuxtrc` file can be used to configure Nuxt with a flat syntax. It is based on [`unjs/rc9`](https://github.com/unjs/rc9).
|
||||||
|
|
||||||
|
::tip
|
||||||
|
For more advanced configurations, use [`nuxt.config`](/docs/guide/directory-structure/nuxt-config).
|
||||||
|
::
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```bash [.nuxtrc]
|
||||||
|
# Disable SSR
|
||||||
|
ssr=false
|
||||||
|
|
||||||
|
# Configuration for `@nuxt/devtools`
|
||||||
|
devtools.enabled=true
|
||||||
|
|
||||||
|
# Add Nuxt modules
|
||||||
|
modules[]=@nuxt/image
|
||||||
|
modules[]=nuxt-security
|
||||||
|
```
|
||||||
|
|
||||||
|
If present, the properties in the `nuxt.config` file will overwrite the properties in `.nuxtrc` file.
|
||||||
|
|
||||||
|
::read-more{to="/docs/api/configuration/nuxt-config"}
|
||||||
|
Discover all the available options in the **Nuxt configuration** documentation.
|
||||||
|
::
|
||||||
|
|
||||||
|
## Global `.nuxtrc` File
|
||||||
|
|
||||||
|
You can also create a global `.nuxtrc` file in your home directory to apply configurations globally.
|
||||||
|
|
||||||
|
- On macOS/Linux, this file is located at:
|
||||||
|
|
||||||
|
```md
|
||||||
|
~/.nuxtrc
|
||||||
|
```
|
||||||
|
|
||||||
|
- On Windows, it is located at:
|
||||||
|
|
||||||
|
```md
|
||||||
|
C:\Users\{username}\.nuxtrc
|
||||||
|
```
|
||||||
|
|
||||||
|
This global `.nuxtrc` file allows you to define default settings that apply to all Nuxt projects on your system. However, project-level `.nuxtrc` files will override these global settings, and `nuxt.config` will take precedence over both.
|
@ -31,12 +31,4 @@ export default defineNuxtConfig({
|
|||||||
Discover all the available options in the **Nuxt configuration** documentation.
|
Discover all the available options in the **Nuxt configuration** documentation.
|
||||||
::
|
::
|
||||||
|
|
||||||
To ensure your configuration is up to date, Nuxt will make a full restart when detecting changes in the main configuration file, the [`.env`](/docs/guide/directory-structure/env), [`.nuxtignore`](/docs/guide/directory-structure/nuxtignore) and `.nuxtrc` dotfiles.
|
To ensure your configuration is up to date, Nuxt will make a full restart when detecting changes in the main configuration file, the [`.env`](/docs/guide/directory-structure/env), [`.nuxtignore`](/docs/guide/directory-structure/nuxtignore) and [`.nuxtrc`](/docs/guide/directory-structure/nuxtrc) dotfiles.
|
||||||
|
|
||||||
The `.nuxtrc` file can be used to configure Nuxt with a flat syntax. It is based on [`unjs/rc9`](https://github.com/unjs/rc9).
|
|
||||||
|
|
||||||
``` [.nuxtrc]
|
|
||||||
ssr=false
|
|
||||||
```
|
|
||||||
|
|
||||||
If present the properties in `.nuxtrc` file will overwrite the properties in the `nuxt.config` file.
|
|
||||||
|
Loading…
Reference in New Issue
Block a user