diff --git a/astro/src/layouts/Layout.astro b/astro/src/layouts/Layout.astro index 3362db3..839b25d 100644 --- a/astro/src/layouts/Layout.astro +++ b/astro/src/layouts/Layout.astro @@ -1,5 +1,5 @@ --- -import "global.css"; +import "@/global.css"; export interface Props { title: string; } diff --git a/astro/src/pages/index.astro b/astro/src/pages/index.astro index a7bf4ae..4aea832 100644 --- a/astro/src/pages/index.astro +++ b/astro/src/pages/index.astro @@ -1,6 +1,6 @@ --- -import Layout from "src/layouts/Layout.astro"; -import { getPosts } from "src/utils/payload"; +import Layout from "@/layouts/Layout.astro"; +import { getPosts } from "@/utils/payload"; const posts = await getPosts(); --- diff --git a/astro/src/pages/posts/[id].astro b/astro/src/pages/posts/[id].astro index 10469e5..f94af85 100644 --- a/astro/src/pages/posts/[id].astro +++ b/astro/src/pages/posts/[id].astro @@ -1,8 +1,8 @@ --- -import Layout from "src/layouts/Layout.astro"; -import Content from "src/components/Content.astro"; -import type { Post } from "src/types"; -import { getPost, getPosts } from "src/utils/payload"; +import Layout from "@/layouts/Layout.astro"; +import Content from "@/components/Content.astro"; +import type { Post } from "@/types"; +import { getPost, getPosts } from "@/utils/payload"; export async function getStaticPaths() { const posts = await getPosts(); diff --git a/astro/src/utils/payload.ts b/astro/src/utils/payload.ts index 18b1b48..c5b4fe5 100644 --- a/astro/src/utils/payload.ts +++ b/astro/src/utils/payload.ts @@ -1,4 +1,4 @@ -import type { Post } from "src/types"; +import type { Post } from "@/types"; const url = import.meta.env.DEV ? "http://payload:3001" diff --git a/astro/tsconfig.json b/astro/tsconfig.json index c8cce98..2224ceb 100644 --- a/astro/tsconfig.json +++ b/astro/tsconfig.json @@ -2,6 +2,9 @@ "extends": "astro/tsconfigs/strict", "compilerOptions": { "types": ["@astrojs/image/client"], - "baseUrl": "." + "baseUrl": ".", + "paths": { + "@/*": ["src/*"] + } } }