Skip to content

Commit

Permalink
refactor: 💡 modify plugin config
Browse files Browse the repository at this point in the history
  • Loading branch information
huyikai committed Dec 22, 2023
1 parent 7aec899 commit 419e5a0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
8 changes: 4 additions & 4 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions packages/@huyikai/vitepress-helper/rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}'`
Expand All @@ -36,7 +36,7 @@ export default [
sourcemap: true
}
],
plugins: [typescript(), terser()]
plugins: [typescript(), terser(),replaceVersion()]
},
{
input: 'bin/index.ts',
Expand Down
28 changes: 13 additions & 15 deletions packages/@huyikai/vitepress-helper/src/config.ts
Original file line number Diff line number Diff line change
@@ -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 <a href="https://github.com/huyikai/vitepress-helper/blob/master/license">MIT</a> License. Based on <a href="https://github.com/huyikai/vitepress-helper">vitepress-helper.v${packageVersion}</a>`,
copyright: 'Copyright © 2023'
}
}
});
4 changes: 3 additions & 1 deletion packages/@huyikai/vitepress-helper/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"baseUrl": ".",
"outDir": "test",
"moduleResolution": "bundler",
"declarationDir": "lib/types"
"declarationDir": "lib/types",
"resolveJsonModule": true,
"esModuleInterop": true
},
"exclude": [
"**/node_modules/**",
Expand Down

0 comments on commit 419e5a0

Please sign in to comment.