From 57ed2a4e5244f6262fba7018fc0ab8e41153e393 Mon Sep 17 00:00:00 2001 From: Xevion Date: Tue, 28 Nov 2023 03:29:11 -0600 Subject: [PATCH] React integration config --- astro.config.mjs | 14 ++++++++------ tsconfig.json | 24 +++++++++++++++++------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index e0691b7..e357af8 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -7,12 +7,13 @@ import rehypePrettyCode from "rehype-pretty-code"; import mdx from "@astrojs/mdx"; /** @type {import('rehype-pretty-code').Options} */ +import react from "@astrojs/react"; const prettyOptions = { theme: "github-dark", keepBackground: false, tokensMap: { - fn: "entity.name.function", - }, + fn: "entity.name.function" + } // getHighlighter: (options) => getHighlighter({ // ...options, // langs: [ @@ -26,13 +27,14 @@ const prettyOptions = { // }), }; + // https://astro.build/config export default defineConfig({ site: "https://undefined.behavio.rs", prefetch: true, - integrations: [tailwind(), sitemap(), robotsTxt(), mdx()], + integrations: [tailwind(), sitemap(), robotsTxt(), mdx(), react()], markdown: { syntaxHighlight: false, - rehypePlugins: [[rehypePrettyCode, prettyOptions]], - }, -}); + rehypePlugins: [[rehypePrettyCode, prettyOptions]] + } +}); \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 6e156f8..5f2f236 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,12 +1,22 @@ { "extends": "astro/tsconfigs/strict", "compilerOptions": { - "baseUrl": ".", + "baseUrl": "/home/xevion/projects/undefined.behavio.rs", "paths": { - "@styles/*": ["src/styles/*"], - "@layouts/*": ["src/layouts/*"], - "@posts/*": ["src/pages/posts/*"], - "@components/*": ["src/components/*"] - } + "@styles/*": [ + "src/styles/*" + ], + "@layouts/*": [ + "src/layouts/*" + ], + "@posts/*": [ + "src/pages/posts/*" + ], + "@components/*": [ + "src/components/*" + ] + }, + "jsx": "react-jsx", + "jsxImportSource": "react" } -} +} \ No newline at end of file