From 05ede65b23de99877081f97fcfb7a7872e12bf67 Mon Sep 17 00:00:00 2001 From: baiqi Date: Mon, 7 Aug 2023 18:07:57 +0800 Subject: [PATCH] =?UTF-8?q?feat(chore):=20arco=E5=85=A8=E9=87=8F=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/config/vite.config.base.ts | 8 ++++---- frontend/config/vite.config.prod.ts | 2 +- frontend/src/main.ts | 7 +++---- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/frontend/config/vite.config.base.ts b/frontend/config/vite.config.base.ts index 675e83e581..24e2992d8e 100644 --- a/frontend/config/vite.config.base.ts +++ b/frontend/config/vite.config.base.ts @@ -3,8 +3,8 @@ import { defineConfig } from 'vite'; import vue from '@vitejs/plugin-vue'; import vueJsx from '@vitejs/plugin-vue-jsx'; import svgLoader from 'vite-svg-loader'; -import configArcoStyleImportPlugin from './plugin/arcoStyleImport'; -import configArcoResolverPlugin from './plugin/arcoResolver'; +// import configArcoStyleImportPlugin from './plugin/arcoStyleImport'; +// import configArcoResolverPlugin from './plugin/arcoResolver'; import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'; import vueSetupExtend from 'vite-plugin-vue-setup-extend'; @@ -14,8 +14,8 @@ export default defineConfig({ vueJsx(), vueSetupExtend(), svgLoader({ svgoConfig: {} }), - configArcoResolverPlugin(), - configArcoStyleImportPlugin(), + // configArcoResolverPlugin(), + // configArcoStyleImportPlugin(), createSvgIconsPlugin({ // 指定需要缓存的图标文件夹 iconDirs: [resolve(process.cwd(), 'src/assets/svg'), resolve(process.cwd(), 'public/images')], // 与本地储存地址一致 diff --git a/frontend/config/vite.config.prod.ts b/frontend/config/vite.config.prod.ts index 07dee24ad7..7f99a57954 100644 --- a/frontend/config/vite.config.prod.ts +++ b/frontend/config/vite.config.prod.ts @@ -12,9 +12,9 @@ export default mergeConfig( rollupOptions: { output: { manualChunks: { + vue: ['vue', 'vue-router', 'pinia', '@vueuse/core', 'vue-i18n'], arco: ['@arco-design/web-vue'], chart: ['echarts', 'vue-echarts'], - vue: ['vue', 'vue-router', 'pinia', '@vueuse/core', 'vue-i18n'], }, }, }, diff --git a/frontend/src/main.ts b/frontend/src/main.ts index d87ef524c4..c26fb23e8a 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -1,4 +1,6 @@ import { createApp } from 'vue'; +import ArcoVue from '@arco-design/web-vue'; +import '@arco-themes/vue-ms-theme-default/index.less'; import FormCreate from '@form-create/arco-design'; import ArcoVueIcon from '@arco-design/web-vue/es/icon'; import SvgIcon from '@/components/pure/svg-icon/index.vue'; @@ -11,9 +13,6 @@ import './mock'; import App from './App.vue'; // eslint-disable-next-line import/no-unresolved import 'virtual:svg-icons-register'; -// Styles are imported via arco-plugin. See config/plugin/arcoStyleImport.ts in the directory for details -// 样式通过 arco-plugin 插件导入。详见目录文件 config/plugin/arcoStyleImport.ts -// https://arco.design/docs/designlab/use-theme-package import '@/assets/style/global.less'; async function bootstrap() { @@ -22,7 +21,7 @@ async function bootstrap() { app.use(store); // 注册国际化,需要异步阻塞,确保语言包加载完毕 await setupI18n(app); - + app.use(ArcoVue); app.use(ArcoVueIcon); app.component('MsIcon', MSIcon); app.component('SvgIcon', SvgIcon);