docs: 优化文档

This commit is contained in:
winixt 2024-11-20 20:21:04 +08:00
parent ad6700279a
commit 71621a4acc
2 changed files with 65 additions and 57 deletions

View File

@ -1,4 +1,3 @@
export const zh = { export const zh = {
'/guide/': [ '/guide/': [
{ {
@ -6,12 +5,12 @@ export const zh = {
items: [ items: [
{ {
text: '介绍', text: '介绍',
link: '/guide/index.md' link: '/guide/index.md',
}, },
{ {
text: '快速上手', text: '快速上手',
link: '/guide/getting-started.md' link: '/guide/getting-started.md',
} },
], ],
}, },
{ {
@ -19,35 +18,44 @@ export const zh = {
items: [ items: [
{ {
text: '目录结构', text: '目录结构',
link: '/guide/directory-structure.md' link: '/guide/directory-structure.md',
},{ },
{
text: 'Vite 和 Webpack 双构建', text: 'Vite 和 Webpack 双构建',
link: '/guide/builder.md' link: '/guide/builder.md',
},{ },
{
text: '编译时配置', text: '编译时配置',
link: '/guide/config.md' link: '/guide/config.md',
},{ },
{
text: '运行时配置', text: '运行时配置',
link: '/guide/runtime-config.md' link: '/guide/runtime-config.md',
},{ },
{
text: '环境变量', text: '环境变量',
link: '/guide/env.md' link: '/guide/env.md',
},{ },
{
text: '路由', text: '路由',
link: '/guide/route.md' link: '/guide/route.md',
},{ },
{
text: '插件', text: '插件',
link: '/guide/plugin.md' link: '/guide/plugin.md',
},{ },
{
text: 'HTML 模板', text: 'HTML 模板',
link: '/guide/template.md' link: '/guide/template.md',
},{ },
{
text: 'Mock 数据', text: 'Mock 数据',
link: '/guide/mock.md' link: '/guide/mock.md',
},{ },
text: '从 2.0.x 迁移到 3.0.x', {
link: '/guide/upgrade3.md' text: '从 2.x 迁移到 3.x',
} link: '/guide/upgrade3.md',
},
], ],
}, },
{ {
@ -55,102 +63,102 @@ export const zh = {
items: [ items: [
{ {
text: '使用图片', text: '使用图片',
link: '/guide/image.md' link: '/guide/image.md',
}, },
{ {
text: '使用 css', text: '使用 css',
link: '/guide/css.md' link: '/guide/css.md',
}, },
{ {
text: '静态资源', text: '静态资源',
link: '/guide/public.md' link: '/guide/public.md',
} },
], ],
}, },
{ {
text: '贡献指南', text: '贡献指南',
link: '/guide/contributing.md' link: '/guide/contributing.md',
}, },
{ {
text: '常见问题', text: '常见问题',
link: '/guide/faq.md' link: '/guide/faq.md',
}, },
], ],
'/reference/plugin/': [ '/reference/plugin/': [
{ {
text: '介绍', text: '介绍',
link: '/reference/plugin/index.md' link: '/reference/plugin/index.md',
}, },
{ {
text: 'Plugins', text: 'Plugins',
items: [ items: [
{ {
text: '@fesjs/plugin-access', text: '@fesjs/plugin-access',
link: '/reference/plugin/plugins/access.md' link: '/reference/plugin/plugins/access.md',
}, },
{ {
text: '@fesjs/plugin-enums', text: '@fesjs/plugin-enums',
link: '/reference/plugin/plugins/enums.md' link: '/reference/plugin/plugins/enums.md',
}, },
{ {
text: '@fesjs/plugin-icon', text: '@fesjs/plugin-icon',
link: '/reference/plugin/plugins/icon.md' link: '/reference/plugin/plugins/icon.md',
}, },
{ {
text: '@fesjs/plugin-jest', text: '@fesjs/plugin-jest',
link: '/reference/plugin/plugins/jest.md' link: '/reference/plugin/plugins/jest.md',
}, },
{ {
text: '@fesjs/plugin-layout', text: '@fesjs/plugin-layout',
link: '/reference/plugin/plugins/layout.md' link: '/reference/plugin/plugins/layout.md',
}, },
{ {
text: '@fesjs/plugin-locale', text: '@fesjs/plugin-locale',
link: '/reference/plugin/plugins/locale.md' link: '/reference/plugin/plugins/locale.md',
}, },
{ {
text: '@fesjs/plugin-model', text: '@fesjs/plugin-model',
link: '/reference/plugin/plugins/model.md' link: '/reference/plugin/plugins/model.md',
}, },
{ {
text: '@fesjs/plugin-request', text: '@fesjs/plugin-request',
link: '/reference/plugin/plugins/request.md' link: '/reference/plugin/plugins/request.md',
}, },
{ {
text: '@fesjs/plugin-vuex', text: '@fesjs/plugin-vuex',
link: '/reference/plugin/plugins/vuex.md' link: '/reference/plugin/plugins/vuex.md',
}, },
{ {
text: '@fesjs/plugin-qiankun', text: '@fesjs/plugin-qiankun',
link: '/reference/plugin/plugins/qiankun.md' link: '/reference/plugin/plugins/qiankun.md',
}, },
{ {
text: '@fesjs/plugin-windicss', text: '@fesjs/plugin-windicss',
link: '/reference/plugin/plugins/windicss.md' link: '/reference/plugin/plugins/windicss.md',
}, },
{ {
text: '@fesjs/plugin-sass', text: '@fesjs/plugin-sass',
link: '/reference/plugin/plugins/sass.md' link: '/reference/plugin/plugins/sass.md',
}, },
{ {
text: '@fesjs/plugin-editor', text: '@fesjs/plugin-editor',
link: '/reference/plugin/plugins/editor.md' link: '/reference/plugin/plugins/editor.md',
}, },
{ {
text: '@fesjs/plugin-pinia', text: '@fesjs/plugin-pinia',
link: '/reference/plugin/plugins/pinia.md' link: '/reference/plugin/plugins/pinia.md',
}, },
{ {
text: '@fesjs/plugin-watermark', text: '@fesjs/plugin-watermark',
link: '/reference/plugin/plugins/watermark.md' link: '/reference/plugin/plugins/watermark.md',
}, },
{ {
text: '@fesjs/plugin-login', text: '@fesjs/plugin-login',
link: '/reference/plugin/plugins/login.md' link: '/reference/plugin/plugins/login.md',
}, },
{ {
text: '@fesjs/plugin-swc', text: '@fesjs/plugin-swc',
link: '/reference/plugin/plugins/swc.md' link: '/reference/plugin/plugins/swc.md',
}, },
], ],
}, },
@ -158,10 +166,10 @@ export const zh = {
text: '插件开发', text: '插件开发',
items: [{ items: [{
text: '插件介绍', text: '插件介绍',
link: '/reference/plugin/dev/index.md' link: '/reference/plugin/dev/index.md',
}, { }, {
text: '插件API', text: '插件API',
link: '/reference/plugin/dev/api.md' link: '/reference/plugin/dev/api.md',
}], }],
}, },
], ],

View File

@ -1,17 +1,17 @@
# 从 2.0.x 迁移到 3.0.x # 从 2.x 迁移到 3.x
## 版本 3.0.x 的 break ## 版本 3.x 的 break
1. 编译时的 [base](../reference/config/index.md/#base) 配置,移到了 [router.base](../reference/config/index.md/#router) 下。 1. 编译时的 [base](../reference/config/index.md/#base) 配置,移到了 [router.base](../reference/config/index.md/#router) 下。
2. [webpack-dev-server](https://github.com/webpack/webpack-dev-server) 从 `v3.x` 升级到了 `v4.x`,如果遇到配置不兼容,可以查看[webpack-dev-server 3.x 升级 4.x](https://github.com/webpack/webpack-dev-server/blob/master/migration-v4.md)。 2. [webpack-dev-server](https://github.com/webpack/webpack-dev-server) 从 `v3.x` 升级到了 `v4.x`,如果遇到配置不兼容,可以查看[webpack-dev-server 3.x 升级 4.x](https://github.com/webpack/webpack-dev-server/blob/master/migration-v4.md)。
3. [layout 插件](../reference/plugin/plugins/layout.md#_4-x-升级到-5-x) 有一些属性变更 3. [layout 插件](../reference/plugin/plugins/layout.md#_4-x-升级到-5-x) 有一些属性变更
3. [request 插件](../reference/plugin/plugins/request.md#_2-x-升级到-3-x) 有一些参数变更 3. [request 插件](../reference/plugin/plugins/request.md#_2-x-升级到-3-x) 有一些参数变更,升级请使用最新版本
## 继续使用 Webpack ## 继续使用 Webpack
1. 添加 Webpack 构建依赖包: `npm i @fesjs/builder-webpack -D` 1. 添加 Webpack 构建依赖包: `npm i @fesjs/builder-webpack -D`
2. 如果设置了 `publicPath: './'`,请更改为 `publicPath: ''` 2. `dev``publicPath` 配置不能为 `./`,请更改为 `auto`
3. 将 html 模版文件从 `public/index.html` 文件挪到项目根目录,移除 [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin) 相关配置,具体模版变量使用请查看[HTML 模版](../guide/template.html)。 3. 将 html 模版文件从 `public/index.html` 挪到项目根目录,移除 [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin) 相关配置,具体模版变量使用请查看[HTML 模版](../guide/template.html)。
## 换成 Vite ## 换成 Vite
@ -22,7 +22,7 @@
## 插件 ## 插件
插件都需要升级到 `3.0.x` 版本,新版添加了兼容`builder`的逻辑,但是提供的接口和配置没有变化,只需要升级版本即可使用。 插件都需要升级到 `3.x` 版本,新版添加了兼容`builder`的逻辑,但是提供的接口和配置没有变化,只需要升级版本即可使用。
- [@fesjs/plugin-layout](../reference/plugin/plugins/layout.md) 需要升级到`5.0.x`版本。 - [@fesjs/plugin-layout](../reference/plugin/plugins/layout.md) 需要升级到`5.0.x`版本。
- [@fesjs/plugin-locale](../reference/plugin/plugins/locale.md) 需要升级到`4.0.x`版本。 - [@fesjs/plugin-locale](../reference/plugin/plugins/locale.md) 需要升级到`4.0.x`版本。