@nuxt/docs-nightly 5.0.0-29656394.48b15c25 → 5.0.0-29656656.bb4e7ef7
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.
|
@@ -866,6 +866,26 @@ export default defineNuxtConfig({
|
|
|
866
866
|
See PR #31379 for implementation details.
|
|
867
867
|
::
|
|
868
868
|
|
|
869
|
+
## prefetchPreloadTags
|
|
870
|
+
|
|
871
|
+
When a `<NuxtLink>` is prefetched and the destination route has [payload extraction](#payloadextraction) enabled (the default for prerendered and cached routes), forward any `<link rel="preload">` hints that the destination set via [`useHead`](/docs/4.x/api/composables/use-head) (or via modules like [`@nuxt/image`](https://image.nuxt.com)'s `<NuxtImg preload>`) into the current document.
|
|
872
|
+
|
|
873
|
+
The forwarded links are downgraded from `rel="preload"` to `rel="prefetch"` so they don't compete with the current page's critical resources. Only user-defined head tags are forwarded; build-time JS/CSS chunk preloads are already handled separately by the prefetch pipeline.
|
|
874
|
+
|
|
875
|
+
This flag is off by default because, combined with `prefetchOn: 'visibility'` (the `<NuxtLink>` default), it could trigger a lot of cross-route prefetches at once. Enable it once you are confident the destination preloads are worth forwarding for the links your users typically encounter.
|
|
876
|
+
|
|
877
|
+
```ts twoslash [nuxt.config.ts]
|
|
878
|
+
export default defineNuxtConfig({
|
|
879
|
+
experimental: {
|
|
880
|
+
prefetchPreloadTags: true,
|
|
881
|
+
},
|
|
882
|
+
})
|
|
883
|
+
```
|
|
884
|
+
|
|
885
|
+
::read-more{icon="i-simple-icons-github" color="gray" to="https://github.com/nuxt/nuxt/issues/34953" target="_blank"}
|
|
886
|
+
See issue #34953 for motivation.
|
|
887
|
+
::
|
|
888
|
+
|
|
869
889
|
## granularCachedData
|
|
870
890
|
|
|
871
891
|
Whether to call and use the result from `getCachedData` when refreshing data for `useAsyncData` and `useFetch` (whether by `watch`, `refreshNuxtData()`, or a manual `refresh()` call.
|
|
@@ -25,6 +25,7 @@ Property | Type | Description
|
|
|
25
25
|
`import.meta.server` | boolean | True when evaluated on the server side.
|
|
26
26
|
`import.meta.nitro` | boolean | True when evaluated on the server side.
|
|
27
27
|
`import.meta.dev` | boolean | True when running the Nuxt dev server.
|
|
28
|
+
`import.meta.envName` | string | The current Nuxt environment name, including custom values passed via `--envName`.
|
|
28
29
|
`import.meta.test` | boolean | True when running in a test context.
|
|
29
30
|
`import.meta.prerender` | boolean | True when rendering HTML on the server in the prerender stage of your build.
|
|
30
31
|
|