From efc1669b3e8e62dbbcebd642f15e9200fda2d13f Mon Sep 17 00:00:00 2001 From: GyDi Date: Wed, 8 Dec 2021 23:34:23 +0800 Subject: [PATCH] feat: use vite --- .gitignore | 1 - package.json | 20 ++++++++++---------- src/index.html | 4 ---- vite.config.ts | 8 ++++++++ 4 files changed, 18 insertions(+), 15 deletions(-) create mode 100644 vite.config.ts diff --git a/.gitignore b/.gitignore index b12fea5..2e44a3c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,4 @@ dist-ssr *.local package-lock.json yarn.lock -.parcel-cache src-tauri/sidebar diff --git a/package.json b/package.json index e8e89d4..f81c005 100644 --- a/package.json +++ b/package.json @@ -2,16 +2,17 @@ "name": "clash-verge", "version": "0.0.0", "scripts": { - "dev": "tauri dev", - "build": "tauri build", - "web:dev": "parcel src/index.html -p 3000", - "web:build": "parcel build", - "tauri": "tauri" + "dev": "cargo tauri dev", + "build": "cargo tauri build", + "web:dev": "vite", + "web:build": "tsc && vite build", + "web:serve": "vite preview" }, "dependencies": { "@emotion/react": "^11.7.0", "@emotion/styled": "^11.6.0", - "@material-ui/core": "^5.0.0-beta.5", + "@mui/icons-material": "^5.2.1", + "@mui/material": "^5.2.3", "@tauri-apps/api": "^1.0.0-beta.8", "axios": "^0.24.0", "react": "^17.0.0", @@ -19,12 +20,11 @@ "react-router-dom": "^6.0.2" }, "devDependencies": { - "@parcel/transformer-sass": "^2.0.1", - "@tauri-apps/cli": "^1.0.0-beta.10", "@types/react": "^17.0.0", "@types/react-dom": "^17.0.0", - "parcel": "^2.0.1", + "@vitejs/plugin-react": "^1.1.1", "sass": "^1.44.0", - "typescript": "^4.5.2" + "typescript": "^4.5.2", + "vite": "^2.7.1" } } diff --git a/src/index.html b/src/index.html index d03124c..1fb0dd3 100644 --- a/src/index.html +++ b/src/index.html @@ -3,10 +3,6 @@ - Clash Verge diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..28f78f6 --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vite"; +import react from "@vitejs/plugin-react"; + +// https://vitejs.dev/config/ +export default defineConfig({ + root: "src", + plugins: [react()], +});