From 27f42527c4f060d4b0354ff79690262fe287e641 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期三, 24 一月 2024 11:57:15 +0800
Subject: [PATCH] 右側图标和左侧的切换设备对齐样式调整

---
 vite.config.ts |   82 +++++++++++++++++++++++++++++++++++++++--
 1 files changed, 78 insertions(+), 4 deletions(-)

diff --git a/vite.config.ts b/vite.config.ts
index 03be1f2..a5da4ec 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -6,22 +6,55 @@
 import IconsResolver from 'unplugin-icons/resolver'
 import Icons from 'unplugin-icons/vite'
 import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
-
+// 鎵撳寘 鍏煎浣庣増鏈祻瑙堝櫒
+// import legacy from '@vitejs/plugin-legacy'
+// 寮�鍙戠幆澧冨吋瀹�
+import esbuild from 'rollup-plugin-esbuild'
 const pathSrc = path.resolve(__dirname, 'src')
 
 // https://vitejs.dev/config/
 export default defineConfig({
+  server: {
+    proxy: {
+      '/v1/': {
+        // http://192.168.20.119:8003 http://192.168.20.25:7010
+        target: 'http://192.168.20.119:8003',
+        ws: true,
+        changeOrigin: true
+      }
+    }
+  },
   resolve: {
     alias: {
       '@': pathSrc
+    },
+  },
+  
+  build: {
+    minify:'terser',
+    // ,'edge90','firefox90','safari15'
+    target:['chrome52'],
+    cssTarget:["chrome52"],
+  },
+  css:{
+      postcss:{
+          plugins:[
+            require('postcss-pxtorem')({
+              // ipad:1280-800
+              rootValue:160.0, //鎹㈢畻鐨勫熀鏁帮紝 灞忓箷瀹藉害/10
+              propList:['*'],//闇�瑕佽浆鍖栫殑灞炴�э紝*琛ㄧず鎵�鏈夊睘鎬ч兘闇�瑕佽浆鍖�
+              // unitPrecision:5
+            })
+          ]
     }
+
   },
   plugins: [
     vue(),
     // element plus 鑷姩瀵煎叆
     AutoImport({
       // 鑷姩瀵煎叆 Vue 鐩稿叧鍑芥暟锛屽锛歳ef, reactive, toRef 绛�
-      imports: ['vue'],
+      // imports: ['vue'],
       // 鑷姩瀵煎叆 Element Plus 鐩稿叧鍑芥暟锛屽锛欵lMessage, ElMessageBox... (甯︽牱寮�)
       resolvers: [
         ElementPlusResolver(),
@@ -33,6 +66,40 @@
 
       dts: path.resolve(pathSrc, 'auto-imports.d.ts')
     }),
+    // 寮�鍙戠幆澧冨吋瀹�
+    esbuild({
+      target:"chrome64",
+      loaders:{
+        ".vue":'js',
+        ".ts":'js'
+      }
+    }),
+    // 鍏煎浣庣増鏈祻瑙堝櫒
+    // legacy({
+    //   // ie >= 11
+    //   targets: ['defaults', 'not IE 11', 'chrome < 60','firefox < 59'], //闇�瑕佸吋瀹圭殑鐩爣鍒楄〃锛屽彲浠ヨ缃涓�
+    //   additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
+    //   // renderLegacyChunks: true,
+    //   modernPolyfills:true,
+    //   polyfills: [
+    //     'es.symbol',
+    //     'es.array.filter',
+    //     'es.promise',
+    //     'es.promise.finally',
+    //     'es/map',
+    //     'es/set',
+    //     'es.array.for-each',
+    //     'es.object.define-properties',
+    //     'es.object.define-property',
+    //     'es.object.get-own-property-descriptor',
+    //     'es.object.get-own-property-descriptors',
+    //     'es.object.keys',
+    //     'es.object.to-string',
+    //     'web.dom-collections.for-each',
+    //     'esnext.global-this',
+    //     'esnext.string.match-all'
+    //   ]
+    // }),
     Components({
       resolvers: [
         // 鑷姩娉ㄥ唽鍥炬爣缁勪欢
@@ -46,6 +113,13 @@
     }),
     Icons({
       autoInstall: true
-    })
-  ]
+    }),
+  ],
+  // configureWebpack:config=>{
+  //   config.entry.app=['babel-polyfill','./src/main.js']
+  // },
+  // transpileDependencies:['*']
+  // chainWebpack: (config) => {
+  //   config.entry('main').add('babel-polyfill')
+  // },
 })

--
Gitblit v1.8.0