Last active
December 3, 2025 21:18
-
-
Save andrewiggins/9295086feadac9e3d978d5bafd8ea8cc to your computer and use it in GitHub Desktop.
Preact + Vite + TS minimal hello world
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dist | |
| package-lock.json | |
| pnpm-lock.yaml | |
| node_modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script type="module" src="index.tsx"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { render } from "preact"; | |
| render(<h1>Hello World!</h1>, document.body); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "preact-vite-hello-world", | |
| "type": "module", | |
| "scripts": { | |
| "dev": "vite", | |
| "build": "vite build", | |
| "preview": "vite preview", | |
| "tsc": "tsc -p tsconfig.json" | |
| }, | |
| "devDependencies": { | |
| "@preact/preset-vite": "^2.10.2", | |
| "@types/node": "^24.10.1", | |
| "typescript": "^5.9.3", | |
| "vite": "^7.2.6" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| { | |
| "compilerOptions": { | |
| "target": "esnext", | |
| "module": "esnext", | |
| "moduleResolution": "bundler", | |
| "jsx": "react-jsx", | |
| "jsxImportSource": "preact", | |
| "strict": true, | |
| "noEmit": true, | |
| "types": [] | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { defineConfig } from "vite"; | |
| import preact from "@preact/preset-vite"; | |
| export default defineConfig({ | |
| plugins: [preact()], | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment