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

**URL:** <https://forums.unrealengine.com/t/how-to-deal-with-editor-only-modules-in-non-editor-build-targets/1340279>\
**Category:** Platform & Builds\
**Tags:** target, modules, build, unreal-engine, Shipping, question\
**Created:** [October 21, 2023, 11:41pm UTC](https://forums.unrealengine.com/t/how-to-deal-with-editor-only-modules-in-non-editor-build-targets/1340279 "2023-10-21T23:41:24Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![dzemzmcdonalda](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dzemzmcdonalda/32/1214680_2.png) [@dzemzmcdonalda](https://forums.unrealengine.com/u/dzemzmcdonalda)\
**Post date:** [October 22, 2023, 1:40am UTC](https://forums.unrealengine.com/t/how-to-deal-with-editor-only-modules-in-non-editor-build-targets/1340279/3 "2023-10-22T01:40:48Z")

</div>

Okey, found the solution, here:

> [@UnrealEd Dependency Causes Package Failure](https://forums.unrealengine.com/t/unrealed-dependency-causes-package-failure/19940/8):
>
> Working code from 2020. \*.Build.cs: using UnrealBuildTool; public class TanksVr : ModuleRules { public TanksVr(ReadOnlyTargetRules target) : base(target) { PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; bEnforceIWYU = true; PublicDependencyModuleNames.AddRange(new ] { "Core", "CoreUObject", "Engine", "PhysXVehicles", "HeadMountedDisplay", …

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` :

```auto
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 😌

---

_[View the full topic](https://forums.unrealengine.com/t/how-to-deal-with-editor-only-modules-in-non-editor-build-targets/1340279)._
