瀏覽代碼

i don't know what i'm doing here

Khaleel Al-Adhami 2 月之前
父節點
當前提交
760f85e51d
共有 3 個文件被更改,包括 18 次插入3 次删除
  1. 1 1
      reflex/.templates/web/utils/state.js
  2. 14 0
      reflex/.templates/web/vite.config.js
  3. 3 2
      reflex/constants/installer.py

+ 1 - 1
reflex/.templates/web/utils/state.js

@@ -6,7 +6,7 @@ import env from "$/env.json";
 import reflexEnvironment from "$/reflex.json";
 import Cookies from "universal-cookie";
 import { useEffect, useRef, useState } from "react";
-import { useNavigate, useLocation, useSearchParams } from "react-router-dom";
+import { useLocation, useNavigate, useSearchParams } from "react-router";
 import {
   initialEvents,
   initialState,

+ 14 - 0
reflex/.templates/web/vite.config.js

@@ -7,6 +7,20 @@ export default defineConfig((config) => ({
   server: {
     port: process.env.PORT,
   },
+  optimizeDeps: {
+    include: [
+      "@emotion/react",
+      "sonner",
+      "axios",
+      "socket.io-client",
+      "json5",
+      "universal-cookie",
+      "@radix-ui/themes",
+      "react-error-boundary",
+      "react-helmet",
+    ],
+    force: true,
+  },
   resolve: {
     alias: [
       {

+ 3 - 2
reflex/constants/installer.py

@@ -81,7 +81,6 @@ class PackageJson(SimpleNamespace):
     PATH = "package.json"
 
     DEPENDENCIES = {
-        "@emotion/react": "11.14.0",
         "axios": "1.8.3",
         "json5": "2.2.3",
         "react-router": "7.4.0",
@@ -96,6 +95,7 @@ class PackageJson(SimpleNamespace):
         "universal-cookie": "7.2.2",
     }
     DEV_DEPENDENCIES = {
+        "@emotion/react": "11.14.0",
         "autoprefixer": "10.4.21",
         "postcss": "8.5.3",
         "postcss-import": "16.1.0",
@@ -105,5 +105,6 @@ class PackageJson(SimpleNamespace):
     }
     OVERRIDES = {
         # This should always match the `react` version in DEPENDENCIES for recharts compatibility.
-        "react-is": "19.0.0"
+        "react-is": "19.0.0",
+        "cookie": "1.0.2",
     }