Component Config Files in modifications/base/ Get Overwritten during Seed Project build

Problem

When you place a custom app definition for some components in modifications/base/iocd/config/apps/, for example:

modifications/base/iocd/config/apps/bbg-mdf.json

Every time you run iocd build (or npm run build), the file is replaced with the default one shipped, and your customizations are lost.

This only happens for some files in modifications/base/iocd/config/apps/. Other files placed in the same folder (e.g. bbg.json placed alongside bbg-mdf.json) are untouched by the build.


Why This Happens

A component installed via the seed project can ship its own component.json with a postInstall.modifications entry that seeds default config files directly into modifications/base/. The bbg-mdf component is one example where every install copies the component’s default mdf-app-def.json over your bbg-mdf.json.

During iocd build, components are reinstalled first, which triggers this overwrite, and only then are modifications applied. So by the time applyModifications runs, you already have the default content in base.

Why Some Files Survive and Others Don’t

Whether a file in modifications/base/iocd/config/apps/ gets overwritten on each build depends on the source component. A file is not overwritten when the component’s postInstall.modifications entry sets "overwrite": false.

The bbg component, for example, ships with overwrite: false:

{
    "postInstall": {
        "modifications": [
            {
                ...
                "overwrite": false
            }
        ]
    }
}

With overwrite: false, the seeded default is written only when the destination file doesn’t already exist. Any subsequent install leaves your customized bbg.json alone. You may think of setting overwrite: falsemanually in each component, but this will be temporary. iocd build, will reinstall components (fresh package files), which restores the original component.json without "overwrite": false.


Solution: Put the Override in a Mode-Specific Folder

Place the authoritative custom config in modifications/build/ (for builds) and/or modifications/dev/ (for dev mode):

modifications/build/iocd/config/apps/bbg-mdf.json   # for builds
modifications/dev/iocd/config/apps/bbg-mdf.json     # for dev mode

When applyModifications runs, it applies modifications/base/ first (seeded default), then applies modifications/build/ or modifications/dev/ second, and your custom file overrides the default.

You can leave or delete the file from modifications/base/ - it will be overwritten by the component install regardless.

See Also