mirror of
https://github.com/ArthurDanjou/trpc-nuxt.git
synced 2026-02-02 05:08:01 +01:00
log info about plugin installation
This commit is contained in:
@@ -5,6 +5,11 @@ export default defineNuxtConfig({
|
|||||||
modules: [Module],
|
modules: [Module],
|
||||||
runtimeConfig: {
|
runtimeConfig: {
|
||||||
baseURL: '',
|
baseURL: '',
|
||||||
|
public: {
|
||||||
|
trpc: {
|
||||||
|
installPlugin: false
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
typescript: {
|
typescript: {
|
||||||
strict: true,
|
strict: true,
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ export default defineNuxtModule<ModuleOptions>({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
if (options.installPlugin) {
|
if (finalConfig.installPlugin) {
|
||||||
addImports([
|
addImports([
|
||||||
{ name: 'useClient', from: join(runtimeDir, 'client') },
|
{ name: 'useClient', from: join(runtimeDir, 'client') },
|
||||||
{ name: 'useAsyncQuery', from: join(runtimeDir, 'client') },
|
{ name: 'useAsyncQuery', from: join(runtimeDir, 'client') },
|
||||||
@@ -72,6 +72,9 @@ export default defineNuxtModule<ModuleOptions>({
|
|||||||
|
|
||||||
logger.success('Plugin successfully installed.')
|
logger.success('Plugin successfully installed.')
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
logger.info('Plugin not installed. Create your own @trpc/client client plugin and composables.')
|
||||||
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user