feat: 更新

This commit is contained in:
dengtongyu committed 2023-12-07 10:57:52 +08:00
1 parent caf4fd2b86
commit 16e6cf572d
19 files changed
+226 -1603

No files matched your search

+39 -29
View File
@@ -1,38 +1,48 @@
import { fileURLToPath, URL } from "node:url";
import { defineConfig } from "vite";
import { defineConfig, loadEnv } from "vite";
import vue from "@vitejs/plugin-vue";
import vueJsx from "@vitejs/plugin-vue-jsx";
import legacy from "@vitejs/plugin-legacy";
import VueSetupExtend from "vite-plugin-vue-setup-extend";
import proxyConfig from "./proxy.config";
// https://vitejs.dev/config/
export default defineConfig({
base: "./",
envDir: "./env",
plugins: [
vue(),
vueJsx(),
VueSetupExtend(),
legacy({
// targets: ["defaults", "not IE 11"],
targets: {
"chrome": "120"
},
additionalLegacyPolyfills: ["regenerator-runtime/runtime"],
renderLegacyChunks: true,
polyfills: [
"es.array.to-reversed"
]
})
],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url))
export default defineConfig(({ mode }) => {
// 根据当前工作目录中的 `mode` 加载 .env 文件
// 设置第三个参数为 '' 来加载所有环境变量,而不管是否有 `VITE_` 前缀。
const envDir = `${process.cwd()}/env`;
const env = loadEnv(mode, envDir, "NODE_APP_");
return {
base: "./",
envDir: "./env",
plugins: [
vue(),
vueJsx(),
VueSetupExtend()
],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url))
}
},
server: {
proxy: proxyConfig(env)
}
},
server: {
proxy: proxyConfig
}
};
});
// export default defineConfig({
// base: "./",
// envDir: "./env",
// plugins: [
// vue(),
// vueJsx(),
// VueSetupExtend()
// ],
// resolve: {
// alias: {
// "@": fileURLToPath(new URL("./src", import.meta.url))
// }
// },
// server: {
// proxy: proxyConfig
// }
// });