Open rchl opened 4 months ago
With the latest version of @nuxt/module-builder
this issue also triggers a warning that can't be avoided:
WARN RuntimeModuleHooks is a deprecated naming and will be removed in the future. Please use ModuleRuntimeHooks instead.
Note that I'm not using RuntimeModuleHooks
explicitly anywhere. It's the module builder triggering it with the code it itself generates.
Confirms too, have the error with https://github.com/YsarocK/nuxt-wp/.
Types are not well generated except when removing --stub option of dev:prepare
command.
You can ignore the warning about RuntimeModuleHooks
; it's fixed in https://github.com/nuxt/module-builder/pull/228.
The type files in stub mode are deliberately more expansive to contemplate all possible options you may have while developing (because it's not running continuously so it can't update the file if you add a new export).
What is the issue you are experiencing?
I don't remember what the issue was or in which project I saw it...
I guess we can close it until some better reasoning comes up.
But then... It's not so much about which properties are generated but more about what is exported
. Why would there be discrepancy in that regard? If ModuleOptions
is generated in both cases then why would it only be exported in one case?
Running
nuxt-module-build build --stub
generatestypes.d.mts
like:where the "ModuleHooks, RuntimeModuleHooks, ModuleRuntimeConfig" imports are not exported from "./module".
Running
nuxt-module-build build
generates correct version: