How to deal with Editor-only Modules in non-Editor build targets?

Okey, found the solution, here:

Changing module “Type” did nothing in my case.

I merged the two modules back to only one and used the following condition in [plugin].Build.cs :

if (Target.bBuildEditor)
{
    PublicDependencyModuleNames.AddRange(new string[]{"UnrealEd",});
}

I also had to wrap every header that comes from “UnrealEd” with #if WITH_EDITOR

My project finally compiles to Shipping :relieved:

3 Likes