|
|
@@ -4,6 +4,7 @@ import { defineConfig, loadEnv, ConfigEnv } from 'vite';
|
|
|
import vueSetupExtend from 'vite-plugin-vue-setup-extend-plus';
|
|
|
import viteCompression from 'vite-plugin-compression';
|
|
|
import { buildConfig } from './src/utils/build';
|
|
|
+import vueJsx from '@vitejs/plugin-vue-jsx'
|
|
|
|
|
|
const pathResolve = (dir: string) => {
|
|
|
return resolve(__dirname, '.', dir);
|
|
|
@@ -17,7 +18,7 @@ const alias: Record<string, string> = {
|
|
|
const viteConfig = defineConfig((mode: ConfigEnv) => {
|
|
|
const env = loadEnv(mode.mode, process.cwd());
|
|
|
return {
|
|
|
- plugins: [vue(), vueSetupExtend(), viteCompression(), JSON.parse(env.VITE_OPEN_CDN) ? buildConfig.cdn() : null],
|
|
|
+ plugins: [vue(), vueJsx(), vueSetupExtend(), viteCompression(), JSON.parse(env.VITE_OPEN_CDN) ? buildConfig.cdn() : null],
|
|
|
root: process.cwd(),
|
|
|
resolve: { alias },
|
|
|
base: mode.command === 'serve' ? './' : env.VITE_PUBLIC_PATH,
|
|
|
@@ -34,7 +35,7 @@ const viteConfig = defineConfig((mode: ConfigEnv) => {
|
|
|
changeOrigin: true,
|
|
|
rewrite: (path) => path.replace(/^\/gitee/, ''),
|
|
|
},
|
|
|
- '/Upload':{
|
|
|
+ '/Upload': {
|
|
|
target: env.VITE_API_URL,
|
|
|
changeOrigin: true,
|
|
|
}
|