@nuxt/docs-nightly 4.0.0-29159500.580e95d1 → 4.0.0-29159625.349f7544
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.
|
@@ -1004,6 +1004,44 @@ These options have been set to their current values for some time and we do not
|
|
|
1004
1004
|
|
|
1005
1005
|
* `respectNoSSRHeader`is implementable in user-land with [server middleware](https://github.com/nuxt/nuxt/blob/c660b39447f0d5b8790c0826092638d321cd6821/packages/nuxt/src/core/runtime/nitro/no-ssr.ts#L8-L9)
|
|
1006
1006
|
|
|
1007
|
+
### Removal of Top-Level `generate` Configuration
|
|
1008
|
+
|
|
1009
|
+
🚦 **Impact Level**: Minimal
|
|
1010
|
+
|
|
1011
|
+
#### What Changed
|
|
1012
|
+
|
|
1013
|
+
The top-level `generate` configuration option is no longer available in Nuxt 4. This includes all of its properties:
|
|
1014
|
+
|
|
1015
|
+
* `generate.exclude` - for excluding routes from prerendering
|
|
1016
|
+
* `generate.routes` - for specifying routes to prerender
|
|
1017
|
+
|
|
1018
|
+
#### Reasons for Change
|
|
1019
|
+
|
|
1020
|
+
The top level `generate` configuration was a holdover from Nuxt 2. We've supported `nitro.prerender` for a while now, and it is the preferred way to configure prerendering in Nuxt 3+.
|
|
1021
|
+
|
|
1022
|
+
#### Migration Steps
|
|
1023
|
+
|
|
1024
|
+
Replace `generate` configuration with the corresponding `nitro.prerender` options:
|
|
1025
|
+
|
|
1026
|
+
```diff
|
|
1027
|
+
export default defineNuxtConfig({
|
|
1028
|
+
- generate: {
|
|
1029
|
+
- exclude: ['/admin', '/private'],
|
|
1030
|
+
- routes: ['/sitemap.xml', '/robots.txt']
|
|
1031
|
+
- }
|
|
1032
|
+
+ nitro: {
|
|
1033
|
+
+ prerender: {
|
|
1034
|
+
+ ignore: ['/admin', '/private'],
|
|
1035
|
+
+ routes: ['/sitemap.xml', '/robots.txt']
|
|
1036
|
+
+ }
|
|
1037
|
+
+ }
|
|
1038
|
+
})
|
|
1039
|
+
```
|
|
1040
|
+
|
|
1041
|
+
::read-more{to="https://nitro.build/config/#prerender"}
|
|
1042
|
+
Read more about Nitro's prerender configuration options.
|
|
1043
|
+
::
|
|
1044
|
+
|
|
1007
1045
|
## Nuxt 2 vs. Nuxt 3+
|
|
1008
1046
|
|
|
1009
1047
|
In the table below, there is a quick comparison between 3 versions of Nuxt:
|
package/3.api/6.nuxt-config.md
CHANGED
|
@@ -1340,28 +1340,6 @@ You can set it to false to use the legacy 'Node' mode, which is the default for
|
|
|
1340
1340
|
|
|
1341
1341
|
**See**: [TypeScript PR implementing `bundler` module resolution](https://github.com/microsoft/TypeScript/pull/51669)
|
|
1342
1342
|
|
|
1343
|
-
## generate
|
|
1344
|
-
|
|
1345
|
-
### `exclude`
|
|
1346
|
-
|
|
1347
|
-
This option is no longer used. Instead, use `nitro.prerender.ignore`.
|
|
1348
|
-
|
|
1349
|
-
- **Type**: `array`
|
|
1350
|
-
|
|
1351
|
-
### `routes`
|
|
1352
|
-
|
|
1353
|
-
The routes to generate.
|
|
1354
|
-
|
|
1355
|
-
If you are using the crawler, this will be only the starting point for route generation. This is often necessary when using dynamic routes.
|
|
1356
|
-
It is preferred to use `nitro.prerender.routes`.
|
|
1357
|
-
|
|
1358
|
-
- **Type**: `array`
|
|
1359
|
-
|
|
1360
|
-
**Example**:
|
|
1361
|
-
```js
|
|
1362
|
-
routes: ['/users/1', '/users/2', '/users/3']
|
|
1363
|
-
```
|
|
1364
|
-
|
|
1365
1343
|
## hooks
|
|
1366
1344
|
|
|
1367
1345
|
Hooks are listeners to Nuxt events that are typically used in modules, but are also available in `nuxt.config`.
|