Closed illright closed 2 months ago
Given a file name, an imported path, and a TSConfig object, produce an absolute path to the imported file.
Example (inside $PROJECT_FOLDER):
$PROJECT_FOLDER
// ./src/pages/home/ui/HomePage.tsx import { Button } from "~/shared/ui";
// ./tsconfig.json { "include": ["**/*.ts", "**/*.tsx"], "compilerOptions": { "moduleResolution": "Bundler", "baseUrl": ".", "paths": { "~/*": ["./src/*"], }, }, }
Expected output: $PROJECT_FOLDER/src/shared/ui/index.ts
$PROJECT_FOLDER/src/shared/ui/index.ts
Will transfer this issue to filesystem
Given a file name, an imported path, and a TSConfig object, produce an absolute path to the imported file.
Example (inside
$PROJECT_FOLDER
):Expected output:
$PROJECT_FOLDER/src/shared/ui/index.ts