refactor: configure vite and next.js for correct module loading
This commit is contained in:
		@@ -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>
 | 
			
		||||
 
 | 
			
		||||
@@ -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)をルートとして明示
 | 
			
		||||
});
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user