In modular environments that use Webpack, TypeScript or other tools that transform ES module imports, path aliases are used, a common convention is @ for
It’s a frequent problem for me to transform a project with aliased absolute paths:
import baz from '@/baz';
to relative paths:
import baz from '../../baz';
For instance, a project that uses aliases needs to be merged with another project that doesn’t use aliases, configuring the latter to use aliases isn’t an option due to style guide or other causes.
I would like to achieve this kind of refactoring with IDE of my choice (Jetbrains IDEA/Webstorm/Phpstorm) but would accept a solution with any other IDE (VS Code) or plain Node.js.
How can this be solved?