wujingjing
2024-12-12 bd52da253561e68d9ab31a260a9c23c2745334a7
vite.config.ts
@@ -1,3 +1,4 @@
import { viteCommonjs } from '@originjs/vite-plugin-commonjs';
import vue from '@vitejs/plugin-vue';
import autoprefixer from 'autoprefixer';
import { resolve } from 'path';
@@ -6,6 +7,8 @@
import { defineConfig, loadEnv } from 'vite';
import viteCompression from 'vite-plugin-compression';
import vueSetupExtend from 'vite-plugin-vue-setup-extend-plus';
import { CodeInspectorPlugin } from 'code-inspector-plugin';
const pathResolve = (dir: string) => {
   return resolve(__dirname, '.', dir);
};
@@ -19,8 +22,14 @@
   const env = loadEnv(mode.mode, process.cwd());
   return {
      plugins: [
         CodeInspectorPlugin({
            bundler: 'vite',
            hotKeys: ['shiftKey'],
         }),
         vue(),
         vueSetupExtend(),
         viteCommonjs(),
         viteCompression({
            threshold: 1024000,
         }),
@@ -35,7 +44,7 @@
         host: '0.0.0.0',
         port: env.VITE_PORT as unknown as number,
         open: JSON.parse(env.VITE_OPEN),
         hmr: true,
         hmr: false,
         proxy: {
            '/gitee': {
               target: 'https://gitee.com',