Create local Nuxt modules inside a Nuxt project: Do I need a build step?
Hey there! Question to all that worked with modules, especially local ones:
I want to create some modules that will live only locally inside my nuxt project. I have done that by creating a
This works so far.
My question:
Now I want to install some dependencies and also inject some types from this module into my main app. Normally you would have
I want to create some modules that will live only locally inside my nuxt project. I have done that by creating a
modules/my-module/module.ts and modules/my-module/runtime/plugin.ts like you would get from the module starter template. I am using the module in my main app like:This works so far.
My question:
Now I want to install some dependencies and also inject some types from this module into my main app. Normally you would have
"prepack": "nuxt-module-build", in your package.json which would generate some dist/...mjs files. Is this needed when my module is locally installed directly inside a nuxt app? Or can I get types and dependencies to work without that.