![]() ![]() 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. I expect original JavaScript/TypeScript codebase to remain intact in other respects, so transforming it with a transpiler may be not an option. This cannot be solved with simple search and replace, and fixing import paths manually is tedious and prone to errors. Src/foo/bar/index.js import baz from '././baz' įor 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. Src/foo/bar/index.js import baz from relative paths: ![]() It's a frequent problem for me to transform a project with aliased absolute paths: In modular environments that use Webpack, TypeScript or other tools that transform ES module imports, path aliases are used, a common convention is for src. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |