diff --git a/apps/client/package.json b/apps/client/package.json index 80bd459..a2efbe5 100644 --- a/apps/client/package.json +++ b/apps/client/package.json @@ -10,11 +10,16 @@ }, "dependencies": { "@repo/shared": "workspace:*", + "@types/react": "^19.2.13", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^5.1.3", "pixi.js": "^8.16.0", - "preact": "^10.27.2" + "react": "^19.2.4", + "react-dom": "^19.2.4", + "react-joystick-component": "^6.2.1", + "socket.io-client": "^4.8.3" }, "devDependencies": { - "@preact/preset-vite": "^2.10.2", "@types/node": "^24.10.1", "typescript": "~5.9.3", "vite": "^7.2.4" diff --git a/apps/client/tsconfig.app.json b/apps/client/tsconfig.app.json index 3fe3ab9..ed628d5 100644 --- a/apps/client/tsconfig.app.json +++ b/apps/client/tsconfig.app.json @@ -7,10 +7,6 @@ "lib": ["ES2022", "DOM", "DOM.Iterable"], "types": ["vite/client"], "skipLibCheck": true, - "paths": { - "react": ["./node_modules/preact/compat/"], - "react-dom": ["./node_modules/preact/compat/"] - }, /* Bundler mode */ "moduleResolution": "bundler", @@ -18,8 +14,13 @@ "verbatimModuleSyntax": true, "moduleDetection": "force", "noEmit": true, + + // ↓ ここが重要:React用に設定 "jsx": "react-jsx", - "jsxImportSource": "preact", + + // ⚠️ 削除したもの: + // - "paths": { ... } (Preactへの誘導を削除) + // - "jsxImportSource": "preact" (Preactのルールを削除) /* Linting */ "strict": true, @@ -30,4 +31,4 @@ "noUncheckedSideEffectImports": true }, "include": ["src"] -} +} \ No newline at end of file diff --git a/apps/client/vite.config.ts b/apps/client/vite.config.ts index b5663a6..407cb13 100644 --- a/apps/client/vite.config.ts +++ b/apps/client/vite.config.ts @@ -1,10 +1,14 @@ import { defineConfig } from 'vite' -import preact from '@preact/preset-vite' +import react from '@vitejs/plugin-react' -// https://vite.dev/config/ export default defineConfig({ - plugins: [preact()], + plugins: [react()], server: { - host: true - } -}) + proxy: { + '/socket.io': { + target: 'http://localhost:3000', + ws: true, + }, + }, + }, +}) \ No newline at end of file