From ad25a9a476184b060b8bd5c31b2efd7c776c6564 Mon Sep 17 00:00:00 2001 From: DCloud_JSON Date: Wed, 8 May 2024 13:28:06 +0800 Subject: [PATCH] Create vite.config.js --- vite.config.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 vite.config.js diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 0000000..3574245 --- /dev/null +++ b/vite.config.js @@ -0,0 +1,36 @@ +import { defineConfig } from 'vite'; +import uni from '@dcloudio/vite-plugin-uni'; +import cementingPlugin from './rollup-plugin-uniapp-cementing.js' + +export default defineConfig({ + plugins: [ + cementingPlugin({ + // 需要静态化的页面路径(支持通配符*) + include: [ + '**/uni-im-conversation.vue', + './uni_modules/uni-im/components/uni-im-msg/uni-im-msg.vue', + './uni_modules/uni-im/pages/chat/info.nvue' + ], + components: { + // 声明组件,格式 {"$组件名":{"$cementing":"$组件路径"}} + MsgByType: { + msgUserCard: '@/uni_modules/uni-im/components/uni-im-msg/types/userinfo-card.vue', + msgVideo: '@/uni_modules/uni-im/components/uni-im-msg/types/video.vue', + msgFile: '@/uni_modules/uni-im/components/uni-im-msg/types/file.vue', + msgHistory: '@/uni_modules/uni-im/components/uni-im-msg/types/history.vue', + msgRichText: '@/uni_modules/uni-im/components/uni-im-msg/types/rich-text.vue', + msgCode: '@/uni_modules/uni-im/components/uni-im-msg/types/code.vue', + msgText: '@/uni_modules/uni-im/components/uni-im-msg/types/text.vue', + msgSound: '@/uni_modules/uni-im/components/uni-im-msg/types/sound.vue', + msgImage: '@/uni_modules/uni-im/components/uni-im-msg/types/image.vue', + }, + MsgExtra: { + UniImMsgReader: '@/uni_modules/uni-im-msg-reader/components/uni-im-msg-reader/uni-im-msg-reader.vue', + } + }, + debug: true + }), + uni(), + ], + build:{target: 'es2015'}, +}); \ No newline at end of file -- GitLab