From 7ab2d3b812a994eb229144f925a108eae43449e9 Mon Sep 17 00:00:00 2001 From: Ilia Mashkov Date: Mon, 16 Mar 2026 13:20:53 +0300 Subject: [PATCH] chore: setup absolute imports --- tsconfig.app.json | 12 +++++++++++- vite.config.ts | 10 ++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/tsconfig.app.json b/tsconfig.app.json index a9b5a59..1d9070b 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -22,7 +22,17 @@ "noUnusedParameters": true, "erasableSyntaxOnly": true, "noFallthroughCasesInSwitch": true, - "noUncheckedSideEffectImports": true + "noUncheckedSideEffectImports": true, + + /* FSD path aliases */ + "baseUrl": ".", + "paths": { + "shared/*": ["src/shared/*"], + "entities/*": ["src/entities/*"], + "features/*": ["src/features/*"], + "widgets/*": ["src/widgets/*"], + "app/*": ["src/app/*"] + } }, "include": ["src"] } diff --git a/vite.config.ts b/vite.config.ts index a41c022..614c64c 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,8 +1,18 @@ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import { federation } from "@module-federation/vite"; +import path from "path"; export default defineConfig({ + resolve: { + alias: { + shared: path.resolve(__dirname, "src/shared"), + entities: path.resolve(__dirname, "src/entities"), + features: path.resolve(__dirname, "src/features"), + widgets: path.resolve(__dirname, "src/widgets"), + app: path.resolve(__dirname, "src/app"), + }, + }, plugins: [ react({ babel: {