From 49345844dc953732e015889d58ea73b2bc7adef9 Mon Sep 17 00:00:00 2001
From: 1012414140@qq.com <1012414140@qq.com>
Date: 星期五, 16 十月 2026 09:50:34 +0800
Subject: [PATCH] feat:  去缴费功能

---
 vue.config.js |  151 ++++++++++++++++++++++++++++++++++----------------
 1 files changed, 102 insertions(+), 49 deletions(-)

diff --git a/vue.config.js b/vue.config.js
index 7295a47..36e54b7 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -1,55 +1,108 @@
-var path = require("path")
+var path = require('path')
 module.exports = {
-    baseUrl: './',
-    configureWebpack: {
-        optimization: {
-            minimizer: [
-                new (require('terser-webpack-plugin'))({
-                    terserOptions: {
-                        compress: {
-                            drop_console: true, // 鍒犻櫎鐢熶骇鐜console.log
-                            drop_debugger: true, // 鍒犻櫎debugger
-                        }
-                    }
-                })
-            ]
-        },
-        resolve: {
-            alias: {
-                '@': path.join(__dirname, 'src')
-            }
-        }
+  publicPath: '/',
+  assetsDir: 'static',
+  productionSourceMap: false, // 鍏抽棴sourceMap锛屽噺灏戜骇鐗╀綋绉�
+
+  // 寮哄埗鎶界 CSS 涓虹嫭绔嬫枃浠讹紝涓嶅唴鑱旇繘 JS
+  css: {
+    extract: true
+  },
+
+  configureWebpack: {
+    // ========== 鍙缃細ElementUI / ViewUI / ECharts锛屽繀椤诲缃� vue ==========
+    externals: {
+      'vue': 'Vue',
+      'element-ui': 'ELEMENT',
+      // view-design 4.x 鐨� UMD 鍖咃紙dist/iview.min.js锛夊湪娴忚鍣ㄤ笅鎸傝浇鐨勫叏灞�鍚嶆槸 iview
+      'view-design': 'iview',
+      'echarts': 'echarts'
     },
-    assetsDir: 'static',
-    productionSourceMap: false,
-    devServer: {
-        sockHost: 'localhost',
-        port: 8082,
-        disableHostCheck: true,
-        proxy: {
-            '/':{
-                target:'http://183.196.93.178:8089',
-                //target:'http://127.0.0.1:8089',
-                changeOrigin:true,
-                pathRewrite:{
-                    '/':''
-                }
+    // =======================================================
+
+    optimization: {
+      minimizer: [
+        new (require('terser-webpack-plugin'))({
+          terserOptions: {
+            compress: {
+              drop_console: true, // 绉婚櫎console
+              drop_debugger: true, // 绉婚櫎debugger
+              pure_funcs: ['console.log', 'console.info', 'console.warn']
+            },
+            mangle: {
+              safari10: true
+            },
+            output: {
+              comments: false // 绉婚櫎鎵�鏈夋敞閲�
             }
+          },
+          extractComments: false,
+          parallel: true // 澶氳繘绋嬪帇缂�
+        })
+      ],
+
+      runtimeChunk: 'single',
+
+      splitChunks: {
+        chunks: 'all',
+        minSize: 10 * 1024, // 20kb 鈫� 10kb锛屾媶鍒嗘洿鍏呭垎
+        minChunks: 2,
+        maxAsyncRequests: 30,
+        maxInitialRequests: 30,
+        name: false,
+
+        cacheGroups: {
+          common: {
+            name: 'common',
+            chunks: 'all',
+            minChunks: 2,
+            priority: 5,
+            reuseExistingChunk: true
+          },
+          vendor: {
+            test: /[\\/]node_modules[\\/]/,
+            name: 'vendor',
+            chunks: 'all',
+            priority: 10,
+            reuseExistingChunk: true
+          }
         }
+      }
     },
-    chainWebpack : config => {
-        // 鍥剧墖鍘嬬缉锛堥渶瑕佸畨瑁卛mage-webpack-loader锛歯pm install image-webpack-loader -D锛�
-        config.module
-            .rule('images')
-            .use('image-webpack-loader')
-            .loader('image-webpack-loader')
-            .options({
-                mozjpeg: { progressive: true, quality: 65 },
-                optipng: { enabled: false },
-                pngquant: { quality: [0.65, 0.9], speed: 4 },
-                gifsicle: { interlaced: false },
-                webp: { quality: 75 } // WebP鍘嬬缉璐ㄩ噺
-            })
-            .end();
+    resolve: {
+      alias: {
+        '@': path.join(__dirname, 'src')
+      }
     }
-}
+  },
+
+  // 鍥剧墖浼樺寲 + 鍏抽棴棰勫姞杞藉啑浣�
+  chainWebpack(config) {
+    config.module
+      .rule('images')
+      .use('url-loader')
+      .loader('url-loader')
+      .tap(options => {
+        options.limit = 4 * 1024
+        return options
+      })
+    config.plugins.delete('prefetch')
+    config.plugins.delete('preload')
+  },
+
+  devServer: {
+    sockHost: 'localhost',
+    port: 8082,
+    disableHostCheck: true,
+    proxy: {
+      '/': {
+        target: 'http://183.196.93.178:8089',
+        // target: 'http://192.168.0.147:8089',
+        changeOrigin: true,
+        pathRewrite: {
+          '/': ''
+        }
+      }
+    }
+  }
+}
\ No newline at end of file

--
Gitblit v1.9.1