diff --git a/vite.config.js b/vite.config.js index 973319b..93e88b6 100644 --- a/vite.config.js +++ b/vite.config.js @@ -3,6 +3,20 @@ import react from '@vitejs/plugin-react-swc'; // https://vitejs.dev/config/ export default defineConfig({ + optimizeDeps: { + include: [ + 'react', + 'react-dom', + 'react-router-dom', + 'axios', + 'react-toastify', + ], + esbuildOptions: { + loader: { + '.js': 'jsx', + }, + }, + }, server: { // port for exposing frontend port: 3000, @@ -25,8 +39,9 @@ export default defineConfig({ output: { manualChunks: { react: ['react'], - axios: ['axios'], + 'react-dom': ['react-dom'], 'react-router-dom': ['react-router-dom'], + axios: ['axios'], 'react-toastify': ['react-toastify'], }, },