mirror of
https://github.com/nuxt/nuxt.git
synced 2025-03-21 16:55:57 +00:00
fix(nuxt): add backwards-compatible serialisation for nuxt.options.pages
This commit is contained in:
parent
66f3d93853
commit
fa480e0a0a
@ -97,6 +97,12 @@ export default defineNuxtModule({
|
|||||||
}
|
}
|
||||||
options.enabled = await isPagesEnabled()
|
options.enabled = await isPagesEnabled()
|
||||||
nuxt.options.pages = options
|
nuxt.options.pages = options
|
||||||
|
// For backwards compatibility with `@nuxtjs/i18n` and other modules that serialize `nuxt.options.pages` directly
|
||||||
|
// TODO: remove in a future major
|
||||||
|
Object.defineProperty(nuxt.options.pages, 'toString', {
|
||||||
|
enumerable: false,
|
||||||
|
get: () => () => options.enabled,
|
||||||
|
})
|
||||||
|
|
||||||
if (nuxt.options.dev && options.enabled) {
|
if (nuxt.options.dev && options.enabled) {
|
||||||
// Add plugin to check if pages are enabled without NuxtPage being instantiated
|
// Add plugin to check if pages are enabled without NuxtPage being instantiated
|
||||||
|
Loading…
Reference in New Issue
Block a user