diff --git a/bolt-vite-react-ts/.bolt/prompt b/bolt-vite-react-ts/.bolt/prompt index ce91b434..25a4e692 100644 --- a/bolt-vite-react-ts/.bolt/prompt +++ b/bolt-vite-react-ts/.bolt/prompt @@ -3,3 +3,5 @@ For all designs I ask you to make, have them be beautiful, not cookie cutter. Ma By default, this template supports JSX syntax with Tailwind CSS classes, React hooks, and Lucide React for icons. Do not install other packages for UI themes, icons, etc unless absolutely necessary or I request them. Use icons from lucide-react for logos. + +Import project modules with the `@/` path alias (`@/components/Foo`, maps to `src/`) instead of deep relative paths like `../../components/Foo`. diff --git a/bolt-vite-react-ts/tsconfig.app.json b/bolt-vite-react-ts/tsconfig.app.json index c15dbd60..e75b2210 100644 --- a/bolt-vite-react-ts/tsconfig.app.json +++ b/bolt-vite-react-ts/tsconfig.app.json @@ -14,6 +14,12 @@ "noEmit": true, "jsx": "react-jsx", + /* Path alias — depth-invariant imports for src (@/foo === src/foo from any file) */ + "baseUrl": ".", + "paths": { + "@/*": ["src/*"] + }, + /* Linting */ "strict": true, "noUnusedLocals": false, diff --git a/bolt-vite-react-ts/vite.config.ts b/bolt-vite-react-ts/vite.config.ts index 147380af..13cb6a9f 100644 --- a/bolt-vite-react-ts/vite.config.ts +++ b/bolt-vite-react-ts/vite.config.ts @@ -1,9 +1,15 @@ import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; +import { fileURLToPath, URL } from 'node:url'; // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], + resolve: { + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)), + }, + }, optimizeDeps: { exclude: ['lucide-react'], },