Commit bcb0276

HPCesia <me@hpcesia.com>
2026-08-08 04:49:27
Add src root path prefix in tsconfig
1 parent 5515904
Changed files (3)
src/layouts/BaseLayout.astro
@@ -1,6 +1,6 @@
 ---
 import "sanitize.css/sanitize.css";
-import "../styles/global.scss";
+import "@/styles/global.scss";
 
 interface Props {
   title?: string;
src/pages/index.astro
@@ -1,5 +1,5 @@
 ---
-import BaseLayout from "../layouts/BaseLayout.astro";
+import BaseLayout from "@/layouts/BaseLayout.astro";
 ---
 <BaseLayout title="Astro">
   <h1>Astro</h1>
tsconfig.json
@@ -1,5 +1,18 @@
 {
   "extends": "astro/tsconfigs/strict",
-  "include": [".astro/types.d.ts", "**/*"],
-  "exclude": ["dist"]
-}
+  "include": [
+    ".astro/types.d.ts",
+    "**/*"
+  ],
+  "exclude": [
+    "dist"
+  ],
+  "compilerOptions": {
+    "baseUrl": ".",
+    "paths": {
+      "@/*": [
+        "./src/*"
+      ]
+    }
+  }
+}
\ No newline at end of file