Are unused nested assets included upon build?

As I understand unused assets are not included in production builds.

What would happen in the following situation for production builds?

Some Asset.asset
    MyScriptableObject (used)
    MyScriptableObject (unused)
    MyScriptableObject (unused)
    MyScriptableObject (unused)
    MyScriptableObject (unused)
    MyScriptableObject (unused)

Would all of those assets be included, or would the unused ones be left out?

Usually if the “Some Asset.asset” isn’t used only the used asset is included. However i never tried that with ScriptableObjects. The only case i know is a Model asset for example. If you only use the animation-sub-asset, only this asset will be included.

Again, maybe ScriptableObjects behave differently but i never tested it. Why not just build the game and take a look at the editor build log?

If they’re components on the GameObject then, yes, they’ll be included. Unity has no idea whether some piece of code activates them or not, so it’s going to leave them there. There is an EditorOnly Tag in the Inspector drop-down for marking things that you don’t want in your builds.