From fdad9acc2efdf54dacacd1c5595009b4558ca772 Mon Sep 17 00:00:00 2001 From: Haileyesus Date: Thu, 26 Mar 2026 13:16:56 +0300 Subject: [PATCH] feat: setup `@` for importing in the frontend --- tsconfig.json | 4 ++++ vite.config.js | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/tsconfig.json b/tsconfig.json index 57470821..4cbb4cf1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,6 +4,10 @@ "useDefineForClassFields": true, "lib": ["ES2020", "DOM", "DOM.Iterable"], "module": "ESNext", + "baseUrl": ".", + "paths": { + "@/*": ["src/*"] + }, "skipLibCheck": true, "moduleResolution": "Bundler", "resolveJsonModule": true, diff --git a/vite.config.js b/vite.config.js index 88c8e28e..61967cbe 100755 --- a/vite.config.js +++ b/vite.config.js @@ -1,3 +1,4 @@ +import { fileURLToPath, URL } from 'node:url' import { defineConfig, loadEnv } from 'vite' import react from '@vitejs/plugin-react' import { getConnectableHost, normalizeLoopbackHost } from './shared/networkHosts.js' @@ -19,6 +20,11 @@ export default defineConfig(({ mode }) => { return { plugins: [react()], + resolve: { + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)) + } + }, server: { host, port: parseInt(env.VITE_PORT) || 5173,