From 419e5a01a160e153a1f6fb9bc74997a977e95b96 Mon Sep 17 00:00:00 2001 From: huyikai Date: Fri, 22 Dec 2023 14:07:10 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20modify=20plugin=20co?= =?UTF-8?q?nfig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/.vitepress/config.ts | 8 +++--- .../vitepress-helper/rollup.config.ts | 4 +-- .../@huyikai/vitepress-helper/src/config.ts | 28 +++++++++---------- .../@huyikai/vitepress-helper/tsconfig.json | 4 ++- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 6f274b9..d303e5e 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -40,10 +40,10 @@ const vitepressConfig = { { icon: 'github', link: 'https://github.com/huyikai/vitepress-helper' } ], // 网站页脚 - footer: { - message: 'Released under the MIT License.', - copyright: 'Copyright © 2022' - }, + // footer: { + // message: 'Released under the MIT License.', + // copyright: 'Copyright © 2023' + // }, // 文档页脚-上下页显示文字 docFooter: { prev: 'Pervious', diff --git a/packages/@huyikai/vitepress-helper/rollup.config.ts b/packages/@huyikai/vitepress-helper/rollup.config.ts index ee455b5..5c20d23 100644 --- a/packages/@huyikai/vitepress-helper/rollup.config.ts +++ b/packages/@huyikai/vitepress-helper/rollup.config.ts @@ -15,7 +15,7 @@ const replaceVersion = () => { return { name: 'replace-version', transform(code, id) { - if (id.endsWith('create.ts')) { + if (id.endsWith('create.ts')||id.endsWith('config.ts')) { return code.replace( /const packageVersion = '[^']*'/, `const packageVersion = '${version}'` @@ -36,7 +36,7 @@ export default [ sourcemap: true } ], - plugins: [typescript(), terser()] + plugins: [typescript(), terser(),replaceVersion()] }, { input: 'bin/index.ts', diff --git a/packages/@huyikai/vitepress-helper/src/config.ts b/packages/@huyikai/vitepress-helper/src/config.ts index 675e1a8..a40f349 100644 --- a/packages/@huyikai/vitepress-helper/src/config.ts +++ b/packages/@huyikai/vitepress-helper/src/config.ts @@ -1,23 +1,21 @@ -import { defineConfig } from 'vitepress' +import { defineConfig } from 'vitepress'; +const packageVersion = '0.0.0'; export default defineConfig({ title: 'vitepres-helper', description: 'vitepres-helper.', - head: [ - ['link', { rel: 'icon', href: '/vitepress-helper/favicon.ico' }] //浏览器标签icon - ], themeConfig: { - siteTitle: 'VitePress-Helper', //导航栏左侧名称 - logo: '/static/nav-logo.svg', //导航栏左侧头像 - outlineTitle: 'Catalog', //右侧 侧边栏标题 + siteTitle: 'VitePress-Helper', + outlineTitle: 'Catalog', search: { - provider: 'local' // 离线搜索 + provider: 'local' }, - // 导航栏 - nav: [ - { - text: 'test', - link: 'https://huyikai.xyz' - } - ] + docFooter: { + prev: 'Pervious', + next: 'Next' + }, + footer: { + message: `Released under the MIT License. Based on vitepress-helper.v${packageVersion}`, + copyright: 'Copyright © 2023' + } } }); diff --git a/packages/@huyikai/vitepress-helper/tsconfig.json b/packages/@huyikai/vitepress-helper/tsconfig.json index a7ca0d4..ead6e69 100644 --- a/packages/@huyikai/vitepress-helper/tsconfig.json +++ b/packages/@huyikai/vitepress-helper/tsconfig.json @@ -6,7 +6,9 @@ "baseUrl": ".", "outDir": "test", "moduleResolution": "bundler", - "declarationDir": "lib/types" + "declarationDir": "lib/types", + "resolveJsonModule": true, + "esModuleInterop": true }, "exclude": [ "**/node_modules/**",