Unverified Commit 5d8b8c37 authored by boojack's avatar boojack Committed by GitHub

chore: upgrade vite (#728)

* chore: upgrade vite

* Revert "chore: remove lazy import component (#724)"

This reverts commit 688dc230.
parent 564f20d1
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "tsc && vite build", "build": "tsc && vite build",
"serve": "vite preview",
"lint": "eslint --ext .js,.ts,.tsx, src", "lint": "eslint --ext .js,.ts,.tsx, src",
"test": "jest --passWithNoTests" "test": "jest --passWithNoTests"
}, },
...@@ -36,7 +35,7 @@ ...@@ -36,7 +35,7 @@
"@types/react-dom": "^18.0.6", "@types/react-dom": "^18.0.6",
"@typescript-eslint/eslint-plugin": "^5.6.0", "@typescript-eslint/eslint-plugin": "^5.6.0",
"@typescript-eslint/parser": "^5.6.0", "@typescript-eslint/parser": "^5.6.0",
"@vitejs/plugin-react": "^2.0.0", "@vitejs/plugin-react-swc": "^3.0.0",
"autoprefixer": "^10.4.2", "autoprefixer": "^10.4.2",
"eslint": "^8.4.1", "eslint": "^8.4.1",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",
...@@ -49,6 +48,6 @@ ...@@ -49,6 +48,6 @@
"prettier": "2.5.1", "prettier": "2.5.1",
"ts-jest": "^29.0.3", "ts-jest": "^29.0.3",
"typescript": "^4.3.2", "typescript": "^4.3.2",
"vite": "^3.0.0" "vite": "^4.0.0"
} }
} }
import { createBrowserRouter, redirect } from "react-router-dom"; import { createBrowserRouter, redirect } from "react-router-dom";
import { lazy } from "react";
import { isNullorUndefined } from "../helpers/utils"; import { isNullorUndefined } from "../helpers/utils";
import { globalService, userService } from "../services"; import { globalService, userService } from "../services";
import Auth from "../pages/Auth";
import Explore from "../pages/Explore"; const Auth = lazy(() => import("../pages/Auth"));
import Home from "../pages/Home"; const Explore = lazy(() => import("../pages/Explore"));
import MemoDetail from "../pages/MemoDetail"; const Home = lazy(() => import("../pages/Home"));
const MemoDetail = lazy(() => import("../pages/MemoDetail"));
const router = createBrowserRouter([ const router = createBrowserRouter([
{ {
......
import { defineConfig } from "vite"; import { defineConfig } from "vite";
import react from "@vitejs/plugin-react"; import react from "@vitejs/plugin-react-swc";
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
...@@ -8,15 +8,15 @@ export default defineConfig({ ...@@ -8,15 +8,15 @@ export default defineConfig({
host: "0.0.0.0", host: "0.0.0.0",
port: 3000, port: 3000,
proxy: { proxy: {
"/api": { "^/api": {
target: "http://localhost:8080/", target: "http://localhost:8080/",
changeOrigin: true, changeOrigin: true,
}, },
"/o/": { "^/o/": {
target: "http://localhost:8080/", target: "http://localhost:8080/",
changeOrigin: true, changeOrigin: true,
}, },
"/h/": { "^/h/": {
target: "http://localhost:8080/", target: "http://localhost:8080/",
changeOrigin: true, changeOrigin: true,
}, },
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment