rfcs
rfcs copied to clipboard
Register modules via package.json
Introduce a small change to @nuxt/config
that infers if ${rootDir}/package.json
has nuxt.modules
or nuxt.devModules
, loads it and merges them into the config automatically.
This would allow for some modules to to self register into Nuxt applications without having to modify nuxt.config.js
(or, without requiring nuxt.config.js
to exist in the first place).
Usage example: installing @nuxt/press
could update package.json
to include:
"nuxt": {
"modules": ["@nuxt/press"]
}
So users of @nuxt/press
could use press.config.js
(example) without requiring to have a full blown nuxt.config.js
file (for most simple uses).
This opens up a path for specialized modules to be used/implemented as micro frameworks with Nuxt as a core framework. These specialized modules could offer configuration via their own file without requiring users to have nuxt.config.js
.