Skip to content

Commit 2924d6a

Browse files
committed
refactor!: use a single nuxt config key
1 parent 7375f34 commit 2924d6a

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

playground/nuxt.config.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ export default defineNuxtConfig({
22
modules: ['../src/module'],
33
devtools: { enabled: true },
44
compatibilityDate: '2025-05-13',
5-
nuxtifyCore: {
5+
nuxtifyPages: {
6+
// Brand
67
brand: {
78
tagline: 'This is a sample tagline for the pages module.',
89
},
9-
},
10-
nuxtifyPages: {
10+
11+
// Navigation
1112
navigation: {
1213
primary: [
1314
{ text: 'Home', to: '/' },

src/module.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ export default defineNuxtModule<ModuleOptions>({
2424
},
2525
},
2626
defaults: {
27+
// Brand
28+
brand: {
29+
name: '@nuxtify/pages',
30+
},
31+
2732
// Navigation
2833
navigation: {
2934
primary: [],
@@ -60,18 +65,14 @@ export default defineNuxtModule<ModuleOptions>({
6065
async setup(_options, _nuxt) {
6166
const resolver = createResolver(import.meta.url)
6267

63-
// Modules
64-
await installModule('@nuxtify/core', {
65-
brand: {
66-
name: '@nuxtify/pages',
67-
},
68-
})
69-
7068
// Expose module options to app config
7169
_nuxt.options.appConfig.nuxtify = defu(_nuxt.options.appConfig.nuxtify, {
7270
..._options,
7371
})
7472

73+
// Modules
74+
await installModule('@nuxtify/core')
75+
7576
// Layouts
7677
addLayout({
7778
src: resolver.resolve('./runtime/layouts/DefaultLayout.vue'),

0 commit comments

Comments
 (0)