8000 fix(nuxt): add backwards-compatible serialisation for `nuxt.options.p… · nuxt/nuxt@fa480e0 · GitHub
[go: up one dir, main page]

Skip to content

Commit fa480e0

Browse files
committed
fix(nuxt): add backwards-compatible serialisation for nuxt.options.pages
1 parent 66f3d93 commit fa480e0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/nuxt/src/pages/module.ts

+6
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ export default defineNuxtModule({
9797
}
9898
options.enabled = await isPagesEnabled()
9999
nuxt.options.pages = options
100+
// For backwards compatibility with `@nuxtjs/i18n` and other modules that serialize `nuxt.options.pages` directly
101+
// TODO: remove in a future major
102+
Object.defineProperty(nuxt.options.pages, 'toString', {
103+
enumerable: false,
104+
get: () => () => options.enabled,
105+
})
100106

101107
if (nuxt.options.dev && options.enabled) {
102108
// Add plugin to check if pages are enabled without NuxtPage being instantiated

0 commit comments

Comments
 (0)
0