Adding in Segment SDK to Project (or any custom SDK)

Has anyone figured out a way to add in an SDK into projects from within the app builder so that it gets exported?

I have successfully added the react SDK by and was able to make event calls throughout the app as a secondary step to exporting my code. However, with this approach I have to go in an put all those events calls back in every time I export and it takes forever. It require a code snippet in the index.html file and then there are event calls throughout the app at certain places (after clicking a button for example).

Can anyone help me with a better approach to handling this so I can add it once and then it exports with the rest of my code going forward?