Skip to content

Commit

Permalink
,对package.json和相关Rollup配置文件进行了更新,添加了terser插件以优化代码压缩。
Browse files Browse the repository at this point in the history
  • Loading branch information
Null committed Jul 31, 2024
1 parent 8ad2b7d commit 24b2a2a
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 19 deletions.
10 changes: 9 additions & 1 deletion docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,18 @@ export default defineConfig({
sidebar: [
{
text: '指南',
items: [
{ text: '介绍', link: '/guide' },
{ text: '安装', link: '/install' },
{ text: '快速上手', link: '/start' },
]
},
{
items: [
...getRouterConfig(),
]
}
},

],

socialLinks: [
Expand Down
6 changes: 1 addition & 5 deletions docs/.vitepress/router.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ const Router = {

function getRouterConfig(langPrefix = '/') {
return [
{
text: '介绍',
link: `${langPrefix}introduce`,
},
...Object.entries(Router).map(([text, children]) => ({
text,
items: children.map(hookName => ({
Expand All @@ -42,7 +38,7 @@ function getRouterConfig(langPrefix = '/') {
}



getRouterConfig()


export {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.6",
"@types/node": "^20.14.11",
"@vitepress-demo-preview/component": "^2.3.2",
Expand Down
2 changes: 2 additions & 0 deletions packages/hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
"publishConfig": {
"registry": "https://registry.npmjs.org/"
},
"repository": "https://github.com/zjydipingxian/hooks-encode",
"homepage": "https://github.com/zjydipingxian/hooks-encode",
"files": [
"dist",
"lib",
Expand Down
2 changes: 2 additions & 0 deletions packages/hooks/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { nodeResolve } from '@rollup/plugin-node-resolve'; // 查找和打包nod
import typescript from '@rollup/plugin-typescript'; // 解析TypeScript
import { babel, getBabelOutputPlugin } from '@rollup/plugin-babel';
import del from 'rollup-plugin-delete';
import terser from '@rollup/plugin-terser';
import { fileURLToPath } from 'url';
import path from 'path';
import fs from 'fs';
Expand All @@ -24,6 +25,7 @@ const tsPlugins = [
nodeResolve(), // 允许你使用 'import' 语句来导入
commonJS(), // 允许你导入 CommonJS 模块
babel({ babelHelpers: 'bundled' }),
terser(),
];

// ES 模块构建配置
Expand Down
115 changes: 102 additions & 13 deletions pnpm-lock.yaml

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

0 comments on commit 24b2a2a

Please sign in to comment.