refactor(更新前端): 🔀 更新前端项目版本

This commit is contained in:
H0nGzA1
2023-02-13 01:32:27 +08:00
parent 4bd3dac4ac
commit 4a37ce3a4f
95 changed files with 654 additions and 14067 deletions

View File

@@ -2,6 +2,7 @@ import vue from '@vitejs/plugin-vue';
import { resolve } from 'path';
import { defineConfig, loadEnv, ConfigEnv } from 'vite';
import vueSetupExtend from 'vite-plugin-vue-setup-extend';
import vueJsx from '@vitejs/plugin-vue-jsx'
const pathResolve = (dir: string) => {
return resolve(__dirname, '.', dir);
@@ -9,13 +10,14 @@ const pathResolve = (dir: string) => {
const alias: Record<string, string> = {
'/@': pathResolve('./src/'),
'@views': pathResolve('./src/views'),
'vue-i18n': 'vue-i18n/dist/vue-i18n.cjs.js',
};
const viteConfig = defineConfig((mode: ConfigEnv) => {
const env = loadEnv(mode.mode, process.cwd());
return {
plugins: [vue(), vueSetupExtend()],
plugins: [vue(), vueJsx(),vueSetupExtend()],
root: process.cwd(),
resolve: { alias },
base: mode.command === 'serve' ? './' : env.VITE_PUBLIC_PATH,