Skip to content

Commit

Permalink
Replace React with Preact
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrus01337 committed Jul 26, 2024
1 parent 540a46c commit 8ef9dcf
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
5 changes: 2 additions & 3 deletions astro.config.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Binary file modified bun.lockb
Binary file not shown.
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
},
Expand All @@ -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"
}
}
26 changes: 14 additions & 12 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"
}
"extends": "astro/tsconfigs/strict"
}

0 comments on commit 8ef9dcf

Please sign in to comment.