From 6fd8d0fe169f7a11ec1406a2ece5d81217bf365f Mon Sep 17 00:00:00 2001 From: mayinrain <624899618@qq.com> Date: Tue, 2 Apr 2024 16:36:35 +0800 Subject: [PATCH 1/2] =?UTF-8?q?upd:=20=E8=A7=A3=E5=86=B3=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E6=89=93=E5=8C=85=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/.vitepress/config.js | 15 +- .../custom/components/componentDoc.vue | 30 ++-- .../.vitepress/custom/components/constants.js | 42 +++++ .../custom/components/exampleRepl.vue | 154 ++++++++---------- .../custom/components/playground.js | 40 +++-- docs/.vitepress/scripts/genComponentDoc.js | 20 ++- docs/.vitepress/scripts/generate-doc.js | 3 + docs/package.json | 3 + package.json | 11 +- scripts/generate-doc.js | 5 - 10 files changed, 180 insertions(+), 143 deletions(-) create mode 100644 docs/.vitepress/custom/components/constants.js create mode 100644 docs/.vitepress/scripts/generate-doc.js create mode 100644 docs/package.json delete mode 100644 scripts/generate-doc.js diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index 146aeb6..dc6e658 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -2,11 +2,9 @@ import { defineConfig } from 'vitepress'; import vueJsx from '@vitejs/plugin-vue-jsx'; -const path = require('path'); +import path from 'path'; -const { - genComponentDoc -} = require('./scripts/genComponentDoc'); +import { genComponentDoc } from './scripts/genComponentDoc.js'; genComponentDoc(); const ssrTransformCustomDir = () => ({ @@ -30,13 +28,12 @@ export default defineConfig({ ignored: ['**/docs/.vueepress/components/**'] } }, - // optimizeDeps: { - // exclude: ['@vue/repl'] - // }, + optimizeDeps: { + exclude: ['@vue/repl'] + }, ssr: { // lodash-es 模块是 esm,ssr 渲染的时候编译成 cjs 的引入方式,会引发 nodejs 的模块加载异常错误 - noExternal: ['lodash-es', '@fesjs/fes-design', '@fesjs/fes-design/icon'], - // external: ['@vue/repl'] + noExternal: ['lodash-es', '@fesjs/fes-design', '@fesjs/fes-design/icon', '@vue/repl'] }, resolve: { extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'], diff --git a/docs/.vitepress/custom/components/componentDoc.vue b/docs/.vitepress/custom/components/componentDoc.vue index c5b1526..07ed8de 100644 --- a/docs/.vitepress/custom/components/componentDoc.vue +++ b/docs/.vitepress/custom/components/componentDoc.vue @@ -5,7 +5,7 @@