perf: 优化 vite 依赖预构建在平台里的配置

This commit is contained in:
xiaoxian521 2022-11-25 15:50:21 +08:00
parent 78820f1049
commit aedc10a6dc

View File

@ -45,8 +45,47 @@ export default ({ command, mode }: ConfigEnv): UserConfigExport => {
proxy: {}
},
plugins: getPluginsList(command, VITE_CDN, VITE_COMPRESSION),
// https://cn.vitejs.dev/config/dep-optimization-options.html#dep-optimization-options
optimizeDeps: {
include: ["pinia", "vue-i18n", "lodash-es", "@vueuse/core", "dayjs"],
/**
* vite启动时会将下面 include esm node_modules/.vite
* include里vite 使 node_modules/.vite
* 使 src/main.ts include vite node_modules/.vite
*/
include: [
"xlsx",
"dayjs",
"pinia",
"swiper",
"intro.js",
"vue-i18n",
"lodash",
"lodash-es",
"cropperjs",
"jsbarcode",
"sortablejs",
"swiper/vue",
"@vueuse/core",
"vue3-danmaku",
"v-contextmenu",
"vue-pdf-embed",
"lodash-unified",
"china-area-data",
"@faker-js/faker",
"vue-json-pretty",
"@logicflow/core",
"@pureadmin/utils",
"@howdyjs/mouse-menu",
"@logicflow/extension",
"@amap/amap-jsapi-loader",
"el-table-infinite-scroll",
"@wangeditor/editor-for-vue",
"xgplayer/dist/simple_player",
"xgplayer/es/controls/volume",
"vuedraggable/src/vuedraggable",
"xgplayer/es/controls/screenShot",
"xgplayer/es/controls/playbackRate"
],
exclude: ["@pureadmin/theme/dist/browser-utils"]
},
build: {