From cdc74c7554626b7af4bbeb3ef9707254a53a05f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=9D=E5=85=88=E7=91=9E?= <1490493387@qq.com> Date: Sun, 20 Mar 2022 23:34:43 +0800 Subject: [PATCH] =?UTF-8?q?refactor(vite.config.ts):=20SVG=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vite.config.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index fd72273d..4e88be5a 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,11 +1,9 @@ import {UserConfig, ConfigEnv, loadEnv} from 'vite' import vue from '@vitejs/plugin-vue' import viteSvgIcons from 'vite-plugin-svg-icons'; -// 如果编辑器提示 path 模块找不到,则可以安装一下 @types/node -> npm install @types/node --save-dev import path from 'path' // @see: https://gitee.com/holysheng/vite2-config-description/blob/master/vite.config.ts - export default ({command, mode}: ConfigEnv): UserConfig => { // 获取 .env 环境配置文件 const env = loadEnv(mode, process.cwd()) @@ -16,7 +14,7 @@ export default ({command, mode}: ConfigEnv): UserConfig => { vue(), viteSvgIcons({ // 指定需要缓存的图标文件夹 - iconDirs: [path.resolve(process.cwd(), 'src/assets/icons/svg')], + iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')], // 指定symbolId格式 symbolId: 'icon-[dir]-[name]', }) @@ -43,9 +41,4 @@ export default ({command, mode}: ConfigEnv): UserConfig => { } } ) -} - - - - - +} \ No newline at end of file