In order for Nested Prefabs to keep your prefab references intact and to find any modifications made to a prefab it adds a couple of components to game objects in your prefabs. These components are normally hidden and can be ignored. However, when making a build these components are included as well. Only prefabs that are instanced at runtime have these components. All prefabs in scenes are cleaned automatically when building.
Having these components in a build has a small overhead because these components are loaded and activated. Once they are loaded they will be destroyed immediately as to not interfere with your game. For development builds this should not be an issue. Needless to say, for a release build it is required to have the maximum possible performance.
To remove these internal components in a build there is an option in the menu and an API available.
Manually preparing the project for building
There are two menu items under 'Assets/Nested Prefabs' to preprocess and postprocess the project for a build manually. Simply click 'Preprocess build' before making a build and 'Postprocess build' after.
Using the API to prepare the project
If you are using a custom build pipeline you only have to include two method calls in your build pipeline.
Before making a build you should call:
After the build is finished you should call:
An example of a custom build pipeline can be found in the 'CustomBuildPipeline' script inside the 'Nested Prefabs/Editor' folder.
Using Unity Cloud Build
If you are using Unity Cloud Build there is a simple method you can use. This method will only remove all internal data of Nested Prefabs, without exporting it first. This means it is not possible to restore the data after and this method should never be used in your working project, only in a remote project on Cloud Build.
In the Advanced Options of your build config in Cloud Build please add a Pre-Export Method for: VisualDesignCafe.NestedPrefabs.NestedPrefabsCloudBuildProcessor.PreExportMethod
This will call the PreExportMethod in the NestedPrefabsCloudBuildProcessor script, which can be found in the 'Nested Prefabs/Editor' folder.