Disable external events/layouts when exporting

My understanding is that disabled events are not included in the code/files when exporting a game. Is there a way to do the same for external events/layouts?

I have two games where 75% of the code is similar, but have different levels in external layouts. It would be nice if I could have both games in one file, but disable the events/layouts that I didn’t want to include in the exported game (keep file size down, etc.).

I don’t quite understand what you’re trying to achieve, here. You want to have your two games in a single GDevelop project, and disable/enable some parts, depending on which game you want to export?
Perhaps switching to the multiple files system would help?