I think using locally or globally should depend on the application.
Because, when we use the library locally, sometimes the code is going to be a real mess. Readability is going to low.
So, we should use libraries locally only when there is a possibility for conflicts.
I am not a more experienced person. So, let me know if I am wrong.