File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -48,20 +48,25 @@ export default defineNuxtModule<ModuleOptions>({
48
48
output : {
49
49
path : path . join ( nuxt . options . buildDir , 'client' ) ,
50
50
} ,
51
- plugins : [ '@hey-api/client-nuxt' ] ,
51
+ plugins : options . config . plugins . some ( ( plugin : any ) => {
52
+ const pluginName = typeof plugin === 'string' ? plugin : plugin . name ;
53
+ return pluginName === '@hey-api/plugin-nuxt' ;
54
+ } )
55
+ ? [ ]
56
+ : [ '@hey-api/client-nuxt' ] ,
52
57
} satisfies Partial < UserConfig > ) as UserConfig ;
53
58
59
+ if ( nuxt . options . _prepare ) {
60
+ config . watch = false ;
61
+ }
62
+
54
63
const folder = path . resolve (
55
64
nuxt . options . rootDir ,
56
65
typeof config . output === 'string' ? config . output : config . output . path ,
57
66
) ;
58
67
59
68
nuxt . options . alias [ options . alias ! ] = folder ;
60
69
61
- nuxt . hooks . hookOnce ( 'app:templates' , async ( ) => {
62
- await createClient ( config ) ;
63
- } ) ;
64
-
65
70
// auto-import enabled
66
71
if ( options . autoImport ) {
67
72
await createClient ( config ) ;
@@ -102,6 +107,10 @@ export default defineNuxtModule<ModuleOptions>({
102
107
imports,
103
108
} ) ;
104
109
}
110
+ } else {
111
+ nuxt . hooks . hookOnce ( 'app:templates' , async ( ) => {
112
+ await createClient ( config ) ;
113
+ } ) ;
105
114
}
106
115
} ,
107
116
} ) ;
You can’t perform that action at this time.
0 commit comments