From 8d3f617e403fdbf53a29ca0d48624dc5da74fc94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=A6=82=E6=91=B8=E9=B1=BC=E5=8E=BB?= <1780903673@qq.com> Date: Wed, 10 Apr 2024 12:51:12 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E2=9C=8F=EF=B8=8F=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E5=8F=8A=E6=BC=94=E7=A4=BAdemo=E8=AE=BF?= =?UTF-8?q?=E9=97=AE=E9=80=9F=E5=BA=A6=20(#232)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: ✏️ 优化文档及演示demo访问速度 * docs: ✏️ 按需引入ElementPlus --- docs/.vitepress/config.mts | 40 +++++++- docs/.vitepress/theme/index.ts | 5 +- docs/auto-imports.d.ts | 9 ++ docs/components.d.ts | 14 +++ docs/index.md | 1 - docs/public/alipay.png | Bin 48973 -> 28407 bytes docs/public/alipayQrcode.jpg | Bin 90218 -> 69009 bytes docs/public/phone-case.png | Bin 49844 -> 0 bytes docs/public/phtitle.png | Bin 4904 -> 0 bytes docs/public/weixinQrcode.jpg | Bin 127789 -> 66093 bytes docs/public/wot-design1.png | Bin 8280 -> 0 bytes docs/public/wot-design3.png | Bin 8719 -> 0 bytes docs/public/wx.jpg | Bin 42657 -> 22838 bytes package.json | 3 + pnpm-lock.yaml | 150 +++++++++++++++++++----------- src/manifest.json | 163 +++++++++++++++++---------------- vite.config.ts | 17 +++- 17 files changed, 261 insertions(+), 141 deletions(-) create mode 100644 docs/auto-imports.d.ts create mode 100644 docs/components.d.ts delete mode 100644 docs/public/phone-case.png delete mode 100644 docs/public/phtitle.png delete mode 100644 docs/public/wot-design1.png delete mode 100644 docs/public/wot-design3.png diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index aa7c4dc8..dd5ec906 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -1,15 +1,51 @@ /* * @Author: weisheng * @Date: 2023-07-27 10:26:09 - * @LastEditTime: 2024-03-20 13:15:11 + * @LastEditTime: 2024-04-10 11:31:29 * @LastEditors: weisheng * @Description: - * @FilePath: \wot-design-uni\docs\.vitepress\config.ts + * @FilePath: \wot-design-uni\docs\.vitepress\config.mts * 记得注释 */ import { defineConfig } from 'vitepress'; +import viteCompression from 'vite-plugin-compression' +import AutoImport from 'unplugin-auto-import/vite' +import Components from 'unplugin-vue-components/vite' +import { ElementPlusResolver } from 'unplugin-vue-components/resolvers' + export default defineConfig({ + vite: { + plugins: [ + AutoImport({ + resolvers: [ElementPlusResolver()], + }), + Components({ + resolvers: [ElementPlusResolver()], + }), + viteCompression({ + verbose: true, + disable: false, + threshold: 10240, + algorithm: 'gzip', + ext: '.gz', + }) + ], + ssr: { noExternal: ['element-plus'] } + // build: { + // terserOptions: { + // compress: { + // //生产环境时移除console + // drop_console: true, + // drop_debugger: true + // } + // }, + // // 关闭文件计算 + // reportCompressedSize: false, + // // 关闭生成map文件 可以达到缩小打包体积 + // sourcemap: false // 这个生产环境一定要关闭,不然打包的产物会很大 + // } + }, title: `Wot Design Uni`, description: '一个参照wot-design打造的uni-app组件库', head: [ diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts index ade6ed29..571c181e 100644 --- a/docs/.vitepress/theme/index.ts +++ b/docs/.vitepress/theme/index.ts @@ -1,7 +1,7 @@ /* * @Author: weisheng * @Date: 2023-07-27 12:36:30 - * @LastEditTime: 2024-04-01 17:11:39 + * @LastEditTime: 2024-04-10 10:58:31 * @LastEditors: weisheng * @Description: * @FilePath: \wot-design-uni\docs\.vitepress\theme\index.ts @@ -12,8 +12,6 @@ import Theme from 'vitepress/theme' import './styles/vars.css' import './styles/custom.css' import './styles/scrollbar.scss' -import ElementPlus from 'element-plus' -import 'element-plus/dist/index.css' import HomeFriendly from './components/HomeFriendly.vue' import NavBarTitleAfter from './components/NavBarTitleAfter.vue' @@ -34,7 +32,6 @@ export default { }) }, enhanceApp({ app }) { - app.use(ElementPlus) app.component('SvgImage', SvgImage) app.component('frame', frame) }, diff --git a/docs/auto-imports.d.ts b/docs/auto-imports.d.ts new file mode 100644 index 00000000..fb173ceb --- /dev/null +++ b/docs/auto-imports.d.ts @@ -0,0 +1,9 @@ +/* eslint-disable */ +/* prettier-ignore */ +// @ts-nocheck +// noinspection JSUnusedGlobalSymbols +// Generated by unplugin-auto-import +export {} +declare global { + const ElMessageBox: typeof import('element-plus/es')['ElMessageBox'] +} diff --git a/docs/components.d.ts b/docs/components.d.ts new file mode 100644 index 00000000..371359f6 --- /dev/null +++ b/docs/components.d.ts @@ -0,0 +1,14 @@ +/* eslint-disable */ +/* prettier-ignore */ +// @ts-nocheck +// Generated by unplugin-vue-components +// Read more: https://github.com/vuejs/core/pull/3399 +export {} + +declare module 'vue' { + export interface GlobalComponents { + ElTag: typeof import('element-plus/es')['ElTag'] + RouterLink: typeof import('vue-router')['RouterLink'] + RouterView: typeof import('vue-router')['RouterView'] + } +} diff --git a/docs/index.md b/docs/index.md index 9c918fb0..90c313f0 100644 --- a/docs/index.md +++ b/docs/index.md @@ -50,7 +50,6 @@ footer: false