From b9bd29a1a81f6f7de479e3cc3fdfe3d85fc660bf Mon Sep 17 00:00:00 2001
From: he wei <858544502@qq.com>
Date: 星期三, 23 四月 2025 13:35:06 +0800
Subject: [PATCH] UA 整理提交

---
 vite.config.js |   25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/vite.config.js b/vite.config.js
index 0838efa..9643a16 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -2,14 +2,35 @@
 import vue from '@vitejs/plugin-vue'
 import VueSetupExtend from 'vite-plugin-vue-setup-extend';
 import { fileURLToPath, URL } from 'node:url';
-// import path from 'node:path';
+import svgSprites from 'rollup-plugin-svg-sprites';
+import Inspect from 'vite-plugin-inspect';
+import path from 'node:path';
+import json from '@rollup/plugin-json';
 
 // https://vite.dev/config/
 export default defineConfig((command, mode) => {
 
   const env = loadEnv(mode, process.cwd(), '');
   return {
-    plugins: [vue(), VueSetupExtend()],
+    plugins: [
+      vue(),
+      Inspect(),
+      VueSetupExtend(),
+      json({
+        // 鏀寔鎸夊悕瀵煎叆
+        namedExports: true,
+        // 鐢熸垚 compact 鐗堟湰鐨� JSON
+        compact: true 
+      }),
+      svgSprites({
+        vueComponent: true,
+        exclude: ['node_modules/**'],
+        symbolId(filePath) {
+          const filename = path.basename(filePath);
+          return 'icon-' + filename.substring(0, filename.lastIndexOf('.'));
+        }
+      }),
+    ],
     base: './',
     define: {
       'process.env': env

--
Gitblit v1.9.1