framework
framework copied to clipboard
Add the ability to read module configs from plugin.
Describe the feature
Right now, there's no way to get a module options defined in nuxt.config.ts
.
The only way currently is to write nuxt.config.ts
like this:
import { defineNuxtConfig } from "nuxt/config"
import MyModule from ".."
const config = {
foo: "bar",
toto: "tata",
}
export default defineNuxtConfig({
modules: [MyModule ],
moduleConfig: config,
runtimeConfig: {
public: {
moduleConfig: config,
},
},
})
It is extremely redundant. And it's made even worse if MyModule
has default properties, because they will not be put in the runtime config.
Additional information
- [ ] Would you be willing to help implement this feature?
- [ ] Could this feature be implemented as a module?
Final checks
- [X] Read the contribution guide.
- [X] Check existing discussions and issues.