diff --git a/src/app/main.tsx b/src/app/main.tsx index c781784..4b85166 100644 --- a/src/app/main.tsx +++ b/src/app/main.tsx @@ -1,8 +1,8 @@ import { StrictMode } from "react"; import { createRoot } from "react-dom/client"; import App from "./App.tsx"; -import "../styles/reset.css.ts"; -import "../styles/global.css.ts"; +import "@/styles/reset.css.ts"; +import "@/styles/global.css.ts"; createRoot(document.getElementById("root")!).render( diff --git a/src/pages/home/home-page.css.ts b/src/pages/home/home-page.css.ts index 341cb3b..d1c4cb0 100644 --- a/src/pages/home/home-page.css.ts +++ b/src/pages/home/home-page.css.ts @@ -1,4 +1,4 @@ -import { vars } from '../../styles/theme.css'; +import { vars } from '@/styles/theme.css'; import { style } from '@vanilla-extract/css'; export const main = style({ diff --git a/src/shared/types/global.d.ts b/src/shared/types/global.d.ts new file mode 100644 index 0000000..4589009 --- /dev/null +++ b/src/shared/types/global.d.ts @@ -0,0 +1,13 @@ +declare module '*.css' { + // adjust the shape instead of `any` if you know the exact structure + export const vars: Record; + const classes: { [key: string]: string }; + export default classes; +} + +declare module '*.css.ts' { + // tighten these types to match your actual exports (vars shape, classes, etc.) + export const vars: Record; + const classes: { [key: string]: string }; + export default classes; +} \ No newline at end of file diff --git a/tsconfig.app.json b/tsconfig.app.json index a9b5a59..b5f9f18 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -8,12 +8,20 @@ "types": ["vite/client"], "skipLibCheck": true, + "composite": true, + "declaration" : true, + "declarationMap": true, + "incremental": true, + "outDir": "dist", + /* Bundler mode */ "moduleResolution": "bundler", + "allowJs": true, "allowImportingTsExtensions": true, + "emitDeclarationOnly": true, "verbatimModuleSyntax": true, "moduleDetection": "force", - "noEmit": true, + // "noEmit": true, "jsx": "react-jsx", /* Linting */ diff --git a/tsconfig.json b/tsconfig.json index 1ffef60..1846c6f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,4 +1,18 @@ { + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@/*": ["src/*"] + }, + "esModuleInterop": true, + "target": "es2022", + "module": "ESnext", + "moduleResolution": "bundler", + "jsx": "react-jsx", + "skipLibCheck": true + }, + + "include": ["src"], "files": [], "references": [ { "path": "./tsconfig.app.json" }, diff --git a/tsconfig.node.json b/tsconfig.node.json index 8a67f62..534d4c0 100644 --- a/tsconfig.node.json +++ b/tsconfig.node.json @@ -7,12 +7,20 @@ "types": ["node"], "skipLibCheck": true, + "composite": true, + "declaration" : true, + "declarationMap": true, + "incremental": true, + "outDir": "dist", + /* Bundler mode */ "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "emitDeclarationOnly": true, "verbatimModuleSyntax": true, "moduleDetection": "force", - "noEmit": true, + // "noEmit": true, /* Linting */ "strict": true, diff --git a/tsconfig.tsbuildinfo b/tsconfig.tsbuildinfo new file mode 100644 index 0000000..1dc74ac --- /dev/null +++ b/tsconfig.tsbuildinfo @@ -0,0 +1 @@ +{"root":["./src/vite-env.d.ts","./src/app/app.tsx","./src/app/main.tsx","./src/pages/error/error-page.tsx","./src/pages/home/home-page.css.ts","./src/pages/home/home-page.tsx","./src/pages/login/login-page.tsx","./src/shared/api/axios.ts","./src/shared/assets/svg/index.ts","./src/shared/components/button/button.css.ts","./src/shared/components/button/button.tsx","./src/shared/components/input/input.css.ts","./src/shared/components/input/input.tsx","./src/shared/router/index.tsx","./src/shared/router/path.ts","./src/shared/types/global.d.ts","./src/styles/global.css.ts","./src/styles/reset.css.ts","./src/styles/theme.css.ts"],"version":"5.9.3"} \ No newline at end of file diff --git a/vite.config.ts b/vite.config.ts index 9861d86..fbb5faf 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,7 +1,8 @@ -import { defineConfig } from "vite"; -import react from "@vitejs/plugin-react"; -import svgr from "vite-plugin-svgr"; -import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin"; +import { defineConfig } from 'vite'; +import react from '@vitejs/plugin-react'; +import path from 'path'; +import svgr from 'vite-plugin-svgr'; +import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin'; // https://vite.dev/config/ export default defineConfig({ @@ -14,4 +15,9 @@ export default defineConfig({ react(), vanillaExtractPlugin(), ], + resolve: { + alias: { + '@': path.resolve(__dirname, './src'), + }, + }, });