Strip submodules from a build
Configure submodule stripping settings, profile your build to identify and remove unused submodules, and run the stripped build.
For an overview of the submodule stripping process, refer to Submodule stripping workflow.
Prerequisites
In Player settings, enable Enable Submodule Stripping Compatibility.
Configure submodule stripping settings
To set up submodule stripping:
Go to Window > Web Optimization > Submodule Stripping.
In the Submodule Stripping window, select a build from the list or select Add Build to choose one from your directory.
Note
The build must have been created or rebuilt after this package was installed.
Note
Enable debug symbols in the build during testing.
In the Stripping Settings property, choose the submodule stripping settings to use.
Enable Strip Automatically After Build, if you want these stripping settings to run automatically on new builds.
Profile the build for unused submodules
To profile the build for unused submodules:
Use Default as the Web Template. Currently submodule profiling is guaranteed to work only on this template.
In the Submodule Stripping window, select Add Profiling.
Select Run to launch the build in a browser.
Play the game and interact with all elements to ensure all submodules load. A report of used and unused submodules generates while you play.
When you're done, open the profiling overlay and select Download Report. Save the report to your computer.
Remove unused submodules
To strip out the unused submodules:
In the Submodule Stripping window, select Select Submodules.
In the Select Submodules window, select Import Profiling Data and choose the report you downloaded. Overwrite the existing selection or combine the report with the existing selection. Alternatively, select submodules manually.
Select Strip or return to the Submodule Stripping window to configure more settings.
Run the stripped build
To run the build:
- Select Run to launch a build in the browser.
- Check the build for errors and missing elements. If everything works as expected and the build is error-free, you stripped the right submodules.
Note
Refer to Test the stripped build for the detailed testing process.