mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 15:15:19 +00:00
docs: mention content in upgrade guide v4 folder structure (#28090)
This commit is contained in:
parent
75967e6577
commit
8f84dce539
@ -109,7 +109,8 @@ Nuxt now defaults to a new directory structure, with backwards compatibility (so
|
|||||||
|
|
||||||
* the new Nuxt default `srcDir` is `app/` by default, and most things are resolved from there.
|
* the new Nuxt default `srcDir` is `app/` by default, and most things are resolved from there.
|
||||||
* `serverDir` now defaults to `<rootDir>/server` rather than `<srcDir>/server`
|
* `serverDir` now defaults to `<rootDir>/server` rather than `<srcDir>/server`
|
||||||
* `layers`, `modules` and `public` are resolved relative to `<rootDir>` by default
|
* `layers/`, `modules/` and `public/` are resolved relative to `<rootDir>` by default
|
||||||
|
* if using [Nuxt Content v2.13+](https://github.com/nuxt/content/pull/2649), `content/` is resolved relative to `<rootDir>`
|
||||||
* a new `dir.app` is added, which is the directory we look for `router.options.ts` and `spa-loading-template.html` - this defaults to `<srcDir>/`
|
* a new `dir.app` is added, which is the directory we look for `router.options.ts` and `spa-loading-template.html` - this defaults to `<srcDir>/`
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
@ -131,6 +132,7 @@ app/
|
|||||||
app.config.ts
|
app.config.ts
|
||||||
app.vue
|
app.vue
|
||||||
router.options.ts
|
router.options.ts
|
||||||
|
content/
|
||||||
layers/
|
layers/
|
||||||
modules/
|
modules/
|
||||||
node_modules/
|
node_modules/
|
||||||
@ -157,7 +159,7 @@ nuxt.config.ts
|
|||||||
|
|
||||||
1. Create a new directory called `app/`.
|
1. Create a new directory called `app/`.
|
||||||
1. Move your `assets/`, `components/`, `composables/`, `layouts/`, `middleware/`, `pages/`, `plugins/` and `utils/` folders under it, as well as `app.vue`, `error.vue`, `app.config.ts`. If you have an `app/router-options.ts` or `app/spa-loading-template.html`, these paths remain the same.
|
1. Move your `assets/`, `components/`, `composables/`, `layouts/`, `middleware/`, `pages/`, `plugins/` and `utils/` folders under it, as well as `app.vue`, `error.vue`, `app.config.ts`. If you have an `app/router-options.ts` or `app/spa-loading-template.html`, these paths remain the same.
|
||||||
1. Make sure your `nuxt.config.ts`, `modules/`, `public/` and `server/` folders remain outside the `app/` folder, in the root of your project.
|
1. Make sure your `nuxt.config.ts`, `content/`, `layers/`, `modules/`, `public/` and `server/` folders remain outside the `app/` folder, in the root of your project.
|
||||||
|
|
||||||
However, migration is _not required_. If you wish to keep your current folder structure, Nuxt should auto-detect it. (If it does not, please raise an issue.) The one exception is that if you _already_ have a custom `srcDir`. In this case, you should be aware that your `modules/`, `public/` and `server/` folders will be resolved from your `rootDir` rather than from your custom `srcDir`. You can override this by configuring `dir.modules`, `dir.public` and `serverDir` if you need to.
|
However, migration is _not required_. If you wish to keep your current folder structure, Nuxt should auto-detect it. (If it does not, please raise an issue.) The one exception is that if you _already_ have a custom `srcDir`. In this case, you should be aware that your `modules/`, `public/` and `server/` folders will be resolved from your `rootDir` rather than from your custom `srcDir`. You can override this by configuring `dir.modules`, `dir.public` and `serverDir` if you need to.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user