diff --git a/astro.config.js b/astro.config.js index 725a45c..9f68580 100644 --- a/astro.config.js +++ b/astro.config.js @@ -1,12 +1,11 @@ import mdx from "@astrojs/mdx"; +import preact from "@astrojs/preact"; import tailwind from "@astrojs/tailwind"; import { defineConfig } from "astro/config"; -import react from "@astrojs/react"; - // https://astro.build/config export default defineConfig({ - integrations: [tailwind(), mdx(), react()], + integrations: [tailwind(), mdx(), preact({ compat: true })], server: { port: 3000, host: true, diff --git a/bun.lockb b/bun.lockb index 94a9d6d..f0627f1 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index fe3c63c..99befbd 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "cyrus01337.co.uk", "description": "My personal site for you to ogle, or a way for you to determine how you can contact me", "type": "module", - "version": "1.1.1", + "version": "1.1.2", "scripts": { "dev": "astro dev", "start": "astro dev", @@ -17,13 +17,13 @@ "dependencies": { "@astrojs/check": "^0.7.0", "@astrojs/mdx": "^3.1.2", + "@astrojs/preact": "^3.5.1", "@astrojs/react": "^3.6.0", "@astrojs/tailwind": "^5.1.0", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "astro": "^4.11.1", - "react": "^18.3.1", - "react-dom": "^18.3.1", + "preact": "^10.23.1", "tailwindcss": "^3.4.4", "typescript": "^5.5.2" }, @@ -42,5 +42,9 @@ "theme-change": "^2.5.0", "tsc-files": "^1.1.4", "typescript-eslint": "^8.0.0-alpha.52" + }, + "overrides": { + "react": "npm:@preact/compat@latest", + "react-dom": "npm:@preact/compat@latest" } } diff --git a/tsconfig.json b/tsconfig.json index e10b702..3493b1d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,14 +1,16 @@ { - "compilerOptions": { - "baseUrl": ".", - "noEmit": true, - "paths": { - "@/*": [ - "src/*" - ] + "compilerOptions": { + "baseUrl": ".", + "noEmit": true, + "paths": { + "@/*": ["src/*"], + "react": ["./node_modules/preact/compat/"], + "react/jsx-runtime": ["./node_modules/preact/jsx-runtime"], + "react-dom": ["./node_modules/preact/compat/"], + "react-dom/*": ["./node_modules/preact/compat/*"] + }, + "jsx": "react-jsx", + "jsxImportSource": "preact" }, - "jsx": "react-jsx", - "jsxImportSource": "react" - }, - "extends": "astro/tsconfigs/strict" -} \ No newline at end of file + "extends": "astro/tsconfigs/strict" +}