log info about plugin installation

This commit is contained in:
wobsoriano
2022-11-02 09:34:16 -07:00
parent 182875a781
commit 0c44f73c9f
2 changed files with 9 additions and 1 deletions

View File

@@ -5,6 +5,11 @@ export default defineNuxtConfig({
modules: [Module],
runtimeConfig: {
baseURL: '',
public: {
trpc: {
installPlugin: false
}
}
},
typescript: {
strict: true,

View File

@@ -60,7 +60,7 @@ export default defineNuxtModule<ModuleOptions>({
},
})
if (options.installPlugin) {
if (finalConfig.installPlugin) {
addImports([
{ name: 'useClient', from: join(runtimeDir, 'client') },
{ name: 'useAsyncQuery', from: join(runtimeDir, 'client') },
@@ -72,6 +72,9 @@ export default defineNuxtModule<ModuleOptions>({
logger.success('Plugin successfully installed.')
}
else {
logger.info('Plugin not installed. Create your own @trpc/client client plugin and composables.')
}
},
})