refactor: configure vite and next.js for correct module loading

This commit is contained in:
2025-06-04 11:11:45 +09:00
parent 4705247246
commit 34e9c33484
3 changed files with 3 additions and 2 deletions

View File

@ -8,6 +8,6 @@
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
<script type="module" src="/src/main.tsx" defer></script>
</body>
</html>

View File

@ -2,6 +2,7 @@ import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
export default defineConfig({
root: '.', // プロジェクトルートを明示
plugins: [react()],
server: {
port: 3000,
@ -12,5 +13,4 @@ export default defineConfig({
input: "index.html",
},
},
root: process.cwd(), // 現在の作業ディレクトリfrontendをルートとして明示
});