Skip to content

Commit

Permalink
Manual for shouldPreload and shouldPrefetch (#2211)
Browse files Browse the repository at this point in the history
Link for open issue: nuxt/nuxt#18376
  • Loading branch information
hicugi committed Mar 14, 2023
1 parent 5cfa2d3 commit 27bfa06
Showing 1 changed file with 17 additions and 0 deletions.
Expand Up @@ -299,3 +299,20 @@ export default {
}
}
```

## shouldPreload & shouldPrefetch

Creates [\<link\>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link) tag with `rel="preload"` or `rel="prefetch"` for external resources (scripts, styles, etc.).

Default configuration:

```js
export default {
render: {
bundleRenderer: {
shouldPrefetch: () => false,
shouldPreload: (fileWithoutQuery, asType) => ["script", "style"].includes(asType),
},
},
}
```

0 comments on commit 27bfa06

Please sign in to comment.