diff --git a/apps/client/src/app.tsx b/apps/client/src/app.tsx index 5c6272a..8eb8a07 100644 --- a/apps/client/src/app.tsx +++ b/apps/client/src/app.tsx @@ -1,4 +1,4 @@ -import { socketManager } from "./network/SocketManager"; +import { socketManager } from "@client/network/SocketManager"; import { useAppFlow } from "./hooks/useAppFlow"; // 画面遷移先シーンコンポーネント群 diff --git a/apps/client/src/hooks/useAppFlow.ts b/apps/client/src/hooks/useAppFlow.ts index 867b4d0..a891fc9 100644 --- a/apps/client/src/hooks/useAppFlow.ts +++ b/apps/client/src/hooks/useAppFlow.ts @@ -1,5 +1,5 @@ import { useEffect, useState } from "react"; -import { socketManager } from "../network/SocketManager"; +import { socketManager } from "@client/network/SocketManager"; import { appConsts } from "@repo/shared"; import type { appTypes, roomTypes } from "@repo/shared"; diff --git a/apps/client/src/scenes/game/GameManager.ts b/apps/client/src/scenes/game/GameManager.ts index 0a31e31..2d60ceb 100644 --- a/apps/client/src/scenes/game/GameManager.ts +++ b/apps/client/src/scenes/game/GameManager.ts @@ -1,5 +1,5 @@ import { Application, Container, Ticker } from "pixi.js"; -import { socketManager } from "../../network/SocketManager"; +import { socketManager } from "@client/network/SocketManager"; import { config } from "@repo/shared"; import type { playerTypes } from "@repo/shared"; import { BasePlayer, LocalPlayer, RemotePlayer } from "./Player"; diff --git a/apps/client/tsconfig.app.json b/apps/client/tsconfig.app.json index ed628d5..20bf754 100644 --- a/apps/client/tsconfig.app.json +++ b/apps/client/tsconfig.app.json @@ -17,6 +17,11 @@ // ↓ ここが重要:React用に設定 "jsx": "react-jsx", + + "baseUrl": ".", + "paths": { + "@client/*": ["src/*"] + }, // ⚠️ 削除したもの: // - "paths": { ... } (Preactへの誘導を削除) diff --git a/apps/client/vite.config.ts b/apps/client/vite.config.ts index 04fb3d8..6af4a54 100644 --- a/apps/client/vite.config.ts +++ b/apps/client/vite.config.ts @@ -1,4 +1,5 @@ import { defineConfig } from 'vite' +import path from 'node:path' import react from '@vitejs/plugin-react' import { config } from '@repo/shared' @@ -8,6 +9,11 @@ return { plugins: [react()], + resolve: { + alias: { + '@client': path.resolve(__dirname, 'src'), + }, + }, server: isProd ? undefined : {