Nuxt.js lets you customize runtime options for rendering pages
Object
Use this option to customize vue SSR bundle renderer. This option is skipped for spa mode.
module.exports = {
render: {
bundleRenderer: {
directives: {
custom1: function (el, dir) {
// something ...
}
}
}
}
}
⚠Cette page est actuellement en cours de traduction française. Vous pouvez repasser plus tard ou participer à la traduction de celle-ci dès maintenant !
Learn more about available options on [Vue SSR API Reference](https://ssr.vuejs.org/en/api.html#renderer-options). It is recommended to not use this option as Nuxt.js is already providing best SSR defaults and misconfiguration might lead to SSR problems.
Object
{ weak: true }
To disable etag for pages set etag: false
See etag docs for possible options.
Object
{ threshold: 0 }
See compression docs for possible options.
Object
{ push: false }
Activate HTTP2 push headers.
boolean
true
Adds
prefetch
andpreload
links for faster initial page load time.
You may want to only disable this option if have many pages and routes.
boolean
true
on universal mode and false
on spa modeEnable SSR rendering
This option is automatically set based on mode
value if not provided.
This can be useful to dynamically enable/disable SSR on runtime after image builds. (With docker for example)
Object
{}
See serve-static docs for possible options.
Use this to configure to load external resources of Content-Security-Policy
Boolean
or Object
false
Example (nuxt.config.js
)
export default {
render: {
csp: true
}
}
// OR
export default {
render: {
csp: {
hashAlgorithm: 'sha256',
allowedSources: undefined,
policies: undefined
}
}
}
Vous avez vu une erreur ou vous souhaitez contribuer à la documentation ? Éditez cette page sur GitHub !