'How to update all files import automatically after adding a baseUrl in tsconfig?

I have added a baseUrl to my tsconfig file. Now I want to update all the existing imports which looks like ../../../../components/test with the new import /components/test

Is there a way to automate this process and get all the imports updated because I have a lot of files and it will take a lot of times to get them all updated ?

Thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source