From 65bfa203472373638e407778c6af06b38f666ad3 Mon Sep 17 00:00:00 2001
From: longyvfengyun <496960745@qq.com>
Date: 星期四, 30 五月 2024 15:01:06 +0800
Subject: [PATCH] 添加threejs

---
 vite.config.ts |   28 +++++++++++++++++++++++++++-
 1 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/vite.config.ts b/vite.config.ts
index 0ededae..1d2e187 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -7,12 +7,19 @@
 import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
 import Icons from "unplugin-icons/vite";
 import IconsResolver from "unplugin-icons/resolver";
+import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
+import {resolve} from "path";
+import {viteMockServe} from 'vite-plugin-mock';
 
+const pathSrc = resolve(__dirname, "src");
 export default defineConfig(({ mode }: ConfigEnv): UserConfig=>{
   return {
+    assetsInclude: ['**/*.glb'],
     plugins: [
       vue(),
       AutoImport({
+        // 鑷姩瀵煎叆 Vue 鐩稿叧鍑芥暟锛屽锛歳ef, reactive, toRef 绛�
+        imports: ["vue", "pinia", "vue-router",],
         resolvers: [
           ElementPlusResolver(),
           // 鑷姩瀵煎叆鍥炬爣缁勪欢
@@ -39,11 +46,30 @@
         // 鑷姩瀹夎鍥炬爣搴�
         autoInstall: true,
       }),
+      createSvgIconsPlugin({
+        // 鎸囧畾闇�瑕佺紦瀛樼殑鍥炬爣鏂囦欢澶�
+        iconDirs: [resolve(pathSrc, "assets/icons")],
+        // 鎸囧畾symbolId鏍煎紡
+        symbolId: "icon-[dir]-[name]",
+      }),
+      viteMockServe({
+        mockPath: './mock',
+        enable: true
+      }),
     ],
     resolve: {
       alias: {
         '@': fileURLToPath(new URL('./src', import.meta.url))
       }
-    }
+    },
+    css: {
+      // css棰勫鐞嗗櫒
+      preprocessorOptions: {
+        less: {
+          charset: false,
+          additionalData: '@import "./src/styles/global.less";',
+        }
+      },
+    },
   };
 });

--
Gitblit v1.9.1