App config
Each layer of a module, or the module root when it has no layers/ directory, may hold an app/app.config.ts. Its default export is a plain object: branding, Nuxt UI's ui (colors, icons, component themes), or anything the modules read through useDmsAppConfig().
export default defineDmsAppConfig({
branding: { logo: { light: "/branding/logo.svg" } },
ui: { colors: { primary: "emerald" } },
});
Merge order
The loader merges every file with defu, records key by key and arrays concatenated, before the first module is set up, so useDmsAppConfig() already holds the result when a setup runs.
- Modules merge in manifest-priority order, highest first.
- Within a module, its layers merge from the last by name to the first, the order in which a contested
public/file is resolved.
A project's layer therefore overrides the DMS's, and the DMS fills in everything the project leaves out. A setup may still read and extend the config. Nuxt UI's own app config is derived from the result, and so is the config e-mails render with (see E-mails).
In development
ajs dms dev applies an edit at once: the next server render uses it, and the open page updates useDmsAppConfig() and Nuxt UI's app config in place, colors included, without a reload. What the modules' setup changed in the config stays on top of the edited values. Adding or removing a config file is applied the same way.
Entries that still merge their own config
Up to 0.5.6, the loader applied none of these files: an entry merged its own config into useDmsAppConfig() in its setup, as the DMS did up to 0.8. Such an entry keeps working with unchanged values, but its config is now merged twice, and defu concatenates arrays: every array it declares, Nuxt UI's compoundVariants among them, holds its entries twice. Nuxt UI resolves the repeated classes to the same ones, so nothing changes on screen, but an entry should stop merging its own config once it requires a loader that applies it. Until it does, an edit to a config file its entry imports reloads the page in ajs dms dev instead of updating it in place, since the entry imports it too.