File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ export default defineNuxtConfig({
33 devtools : { enabled : true } ,
44 compatibilityDate : '2025-05-13' ,
55 nuxtifyPages : {
6+ // Logs
7+ verboseLogs : true ,
8+
69 // Brand
710 brand : {
811 tagline : 'This is a sample tagline for the pages module.' ,
Original file line number Diff line number Diff line change @@ -71,7 +71,9 @@ export default defineNuxtModule<ModuleOptions>({
7171 } )
7272
7373 // Modules
74- await installModule ( '@nuxtify/core' )
74+ await installModule ( '@nuxtify/core' , {
75+ verboseLogs : _options . verboseLogs ,
76+ } )
7577
7678 // Layouts
7779 addLayout ( {
@@ -105,5 +107,22 @@ export default defineNuxtModule<ModuleOptions>({
105107 file : resolver . resolve ( './runtime/pages/DynamicSlug.vue' ) ,
106108 } )
107109 } )
110+
111+ // Remove duplicate imports (to suppress Nuxt warnings)
112+ _nuxt . hook ( 'imports:extend' , ( imports ) => {
113+ // Find and remove the 'useNuxtifyConfig' import that comes from '@nuxtify/core'
114+ const coreImportIndex = imports . findIndex (
115+ ( imp ) => {
116+ // The 'name' property refers to the exported name of the composable.
117+ // The 'from' property is the path to the source file.
118+ return ( imp . as || imp . name ) === 'useNuxtifyConfig' && imp . from . includes ( '@nuxtify/core' )
119+ } ,
120+ )
121+
122+ if ( coreImportIndex > - 1 ) {
123+ imports . splice ( coreImportIndex , 1 )
124+ if ( _options . verboseLogs ) console . log ( '[nuxtify-pages] Intentionally overriding useNuxtifyConfig from @nuxtify/core.' )
125+ }
126+ } )
108127 } ,
109128} )
You can’t perform that action at this time.
0 commit comments