How to define Target options in a plugin ?

Hi,
I’m looking for a way to define options that are normally found in .Target.cs files (which is defined for a project) but in a plugin.
The goal is that the user of the plugin doesn’t have to add these options himself in the .Target.cs files.

I need these lines of code from .Target.cs :

ProjectDefinitions.Add("ONLINE_SUBSYSTEM_EOS_ENABLE_STEAM=1");
ExtraModuleNames.AddRange(new string[] { "...", "..." });
if (Target.Configuration != UnrealTargetConfiguration.Shipping)
        {
            ExtraModuleNames.AddRange(new string[] { "..." });
        }

I tried with Build.cs files in module :

if(Target.Type == TargetType.Game)
{
	if (Target.Configuration != UnrealTargetConfiguration.Shipping)
	{
	
	}
}
if (Target.Type == TargetType.Editor)
{
			
}
if(Target.Type == TargetType.Server)
{
	if (Target.Configuration != UnrealTargetConfiguration.Shipping)
	{

	});
}

Do you know how to do it ?

did you try:

if (Target.Type == TargetRules.TargetType.Editor))
{
//your code
}