'Replacing resource import from old library by import from new library

I had run into a problem in my javascript project. I was using a resource from a library in my project, and I need to replace all instances of it by a resource of the same name, but from another library. The problem is that I'm importing this resource in more than a hundred files alongisde other resources.

What I need is to replace all instances of something that looks like this:

import {someResource, changedResource, anotherResource} from 'old-library'

By this:

import {someResource, anotherResource} from 'old-library'
import {changedResource} from 'new-library'

I need to keep the old imports that includes this resource that I want to get from the new library as well as importing the changed resource from the new library. Is that a way I can do that in Visual Code or I'll need to use some script in order to do that?



Sources

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

Source: Stack Overflow

Solution Source