Skip to content

Commit 50a4b3b

Browse files
committed
fix: PageMeta type augmentation
1 parent 2061fcf commit 50a4b3b

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

playground/app/pages/contact/index.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ import { definePageMeta } from '#imports'
99
1010
definePageMeta({
1111
name: 'contact-page',
12-
meta: {
13-
drupalFrontendRoute: true,
14-
},
12+
drupalFrontendRoute: true,
1513
languageMapping: {
1614
de: '/de/kontakt',
1715
fr: '/fr/contactez-nous',

src/build/features/frontendRouting/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import fs from 'node:fs'
22
import { addTemplate } from '@nuxt/kit'
3+
import { relative } from 'pathe'
34
import type { NuxtPage } from '@nuxt/schema'
45
import { defineVuepalFeature } from '../defineFeature'
56
import type { FileCache } from '../../classes/FileCache'
@@ -149,8 +150,14 @@ export default defineVuepalFeature<{
149150
description: '',
150151
setup(helper, options) {
151152
helper.addTemplate('page-meta', null, () => {
153+
const relativePath = relative(
154+
helper.paths.moduleBuildDir,
155+
helper.nuxt.options.workspaceDir +
156+
'/node_modules/nuxt/dist/pages/runtime/composables',
157+
)
158+
152159
return `
153-
declare module "#app" {
160+
declare module "${relativePath}" {
154161
interface PageMeta {
155162
/**
156163
* If set to true, this route is considered a "Drupal Frontend Route".

0 commit comments

Comments
 (0)