Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxian521 committed Nov 26, 2022
1 parent aedc10a commit b4d1cff
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 81 deletions.
40 changes: 40 additions & 0 deletions build/optimize.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* 此文件作用于 `vite.config.ts` 的 `optimizeDeps.include` 依赖预构建配置项
* 依赖预构建,`vite` 启动时会将下面 include 里的模块,编译成 esm 格式并缓存到 node_modules/.vite 文件夹,页面加载到对应模块时如果浏览器有缓存就读取浏览器缓存,如果没有会读取本地缓存并按需加载
* 尤其当您禁用浏览器缓存时(这种情况只应该发生在调试阶段)必须将对应模块加入到 include里,否则会遇到开发环境切换页面卡顿的问题(vite 会认为它是一个新的依赖包会重新加载并强制刷新页面),因为它既无法使用浏览器缓存,又没有在本地 node_modules/.vite 里缓存
* 温馨提示:如果您使用的第三方库是全局引入,也就是引入到 src/main.ts 文件里,就不需要再添加到 include 里了,因为 vite 会自动将它们缓存到 node_modules/.vite
*/
export const include = [
"xlsx",
"dayjs",
"pinia",
"swiper",
"lodash",
"intro.js",
"vue-i18n",
"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"
];
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
"@wangeditor/editor": "^5.1.21",
"@wangeditor/editor-for-vue": "^5.1.12",
"animate.css": "^4.1.1",
"axios": "^1.1.3",
"axios": "^1.2.0",
"china-area-data": "^5.0.1",
"cropperjs": "^1.5.12",
"dayjs": "^1.11.5",
"dayjs": "^1.11.6",
"echarts": "^5.4.0",
"el-table-infinite-scroll": "^3.0.1",
"element-plus": "^2.2.22",
"element-plus": "^2.2.25",
"element-resize-detector": "^1.2.4",
"intro.js": "^6.0.0",
"js-cookie": "^3.0.1",
Expand All @@ -61,10 +61,9 @@
"mockjs": "^1.1.0",
"nprogress": "^0.2.0",
"path": "^0.12.7",
"pinia": "^2.0.24",
"pinia": "^2.0.26",
"qrcode": "^1.5.1",
"qs": "^6.11.0",
"resize-observer-polyfill": "^1.5.1",
"responsive-storage": "^2.1.0",
"sortablejs": "^1.15.0",
"swiper": "^8.4.4",
Expand All @@ -79,7 +78,7 @@
"vue-virtual-scroller": "^2.0.0-alpha.1",
"vue3-danmaku": "^1.0.0",
"vuedraggable": "^4.1.0",
"vxe-table": "^4.3.5",
"vxe-table": "^4.3.6",
"xe-utils": "^3.5.7",
"xgplayer": "^2.32.1",
"xlsx": "^0.18.5"
Expand Down
57 changes: 24 additions & 33 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/serverConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"EpThemeColor": "#409EFF",
"ShowLogo": true,
"ShowModel": "smart",
"MenuArrowIconNoTransition": false,
"MenuArrowIconNoTransition": true,
"MapConfigure": {
"amapKey": "97b3248d1553172e81f168cf94ea667e",
"options": {
Expand Down
2 changes: 2 additions & 0 deletions src/components/ReIcon/src/iconifyIconOffline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ import ArrowUpLine from "@iconify-icons/ri/arrow-up-line";
import ArrowDownLine from "@iconify-icons/ri/arrow-down-line";
import Bookmark2Line from "@iconify-icons/ri/bookmark-2-line";
import AddFill from "@iconify-icons/ri/add-circle-line";
import AddLine from "@iconify-icons/ri/add-line";
import ListCheck from "@iconify-icons/ri/list-check";
import More2Fill from "@iconify-icons/ri/more-2-fill";
import Database from "@iconify-icons/ri/database-2-line";
Expand Down Expand Up @@ -114,6 +115,7 @@ addIcon("arrow-up-line", ArrowUpLine);
addIcon("arrow-down-line", ArrowDownLine);
addIcon("bookmark-2-line", Bookmark2Line);
addIcon("add", AddFill);
addIcon("add-line", AddLine);
addIcon("list-check", ListCheck);
addIcon("more-vertical", More2Fill);
addIcon("database", Database);
Expand Down
2 changes: 1 addition & 1 deletion src/views/pure-table/high/echarts/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const { columns, dataList } = useColumns();
<template>
<pure-table row-key="id" border :data="dataList" :columns="columns">
<template #echart="{ index }">
<div :ref="'PieChartRef' + index" style="height: 100px" />
<div :ref="'PieChartRef' + index" class="w-full h-[100px]" />
</template>
</pure-table>
</template>
2 changes: 1 addition & 1 deletion src/views/pure-table/high/edit/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function useColumns() {
// class="flex-bc" flex-bc 代表 flex justify-between items-center 具体看 src/style/tailwind.css 文件
cellRenderer: ({ row, index }) => (
<div
class="flex-bc h-[32px]"
class="flex-bc w-full h-[32px]"
onMouseenter={() => (activeIndex.value = index)}
onMouseleave={() => onMouseleave(index)}
>
Expand Down
41 changes: 2 additions & 39 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import dayjs from "dayjs";
import { resolve } from "path";
import pkg from "./package.json";
import { warpperEnv } from "./build";
import { include } from "./build/optimize";
import { getPluginsList } from "./build/plugins";
import { UserConfigExport, ConfigEnv, loadEnv } from "vite";

Expand Down Expand Up @@ -47,45 +48,7 @@ export default ({ command, mode }: ConfigEnv): UserConfigExport => {
plugins: getPluginsList(command, VITE_CDN, VITE_COMPRESSION),
// https://cn.vitejs.dev/config/dep-optimization-options.html#dep-optimization-options
optimizeDeps: {
/**
* 依赖预构建,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"
],
include,
exclude: ["@pureadmin/theme/dist/browser-utils"]
},
build: {
Expand Down

0 comments on commit b4d1cff

Please sign in to comment.