feat(chore): arco全量加载
This commit is contained in:
parent
9ab2a11af9
commit
05ede65b23
|
@ -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')], // 与本地储存地址一致
|
||||
|
|
|
@ -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'],
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue