feat: 更新环境配置,添加 API 地址,优化数据获取逻辑,支持振动反馈功能
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import path from "node:path";
|
||||
import process from "node:process";
|
||||
import tailwindcss from "@tailwindcss/vite";
|
||||
import legacy from "@vitejs/plugin-legacy";
|
||||
import vue from "@vitejs/plugin-vue";
|
||||
@@ -11,9 +12,7 @@ import { IonicResolver } from "unplugin-vue-components/resolvers";
|
||||
import components from "unplugin-vue-components/vite";
|
||||
import { defineConfig } from "vite";
|
||||
|
||||
const env = dotenv.config({ path: `.env` }).parsed as Record<string, string>;
|
||||
|
||||
console.log("🚀 ~ file: vite.config.ts ~ env:", env);
|
||||
dotenv.config({ path: `.env.${process.env.NODE_ENV}` });
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
@@ -45,7 +44,7 @@ export default defineConfig({
|
||||
host: true,
|
||||
proxy: {
|
||||
"/api": {
|
||||
target: env.VITE_API_URL,
|
||||
target: process.env.VITE_API_URL,
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user