However, whenever I run ionic serve, my index.html file is overwritten!! What is the correct way to include such a library in my project, so that I don’t have to manually insert it after every build??
Fork your ThirdPartyLibrary on github. Create npm package for it and use module from your github repository.
Try find alternative library, that have npm support.
(Not tested). If your library is simple (It consists of a single file and does not need to import other libraries) - you can try to convert it to typescript module and use it directly in your app like other services.