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 = {
'/guide/': [
{
@ -6,12 +5,12 @@ export const zh = {
items: [
{
text: '介绍',
link: '/guide/index.md'
link: '/guide/index.md',
},
{
text: '快速上手',
link: '/guide/getting-started.md'
}
link: '/guide/getting-started.md',
},
],
},
{
@ -19,35 +18,44 @@ export const zh = {
items: [
{
text: '目录结构',
link: '/guide/directory-structure.md'
},{
link: '/guide/directory-structure.md',
},
{
text: 'Vite 和 Webpack 双构建',
link: '/guide/builder.md'
},{
link: '/guide/builder.md',
},
{
text: '编译时配置',
link: '/guide/config.md'
},{
link: '/guide/config.md',
},
{
text: '运行时配置',
link: '/guide/runtime-config.md'
},{
link: '/guide/runtime-config.md',
},
{
text: '环境变量',
link: '/guide/env.md'
},{
link: '/guide/env.md',
},
{
text: '路由',
link: '/guide/route.md'
},{
link: '/guide/route.md',
},
{
text: '插件',
link: '/guide/plugin.md'
},{
link: '/guide/plugin.md',
},
{
text: 'HTML 模板',
link: '/guide/template.md'
},{
link: '/guide/template.md',
},
{
text: 'Mock 数据',
link: '/guide/mock.md'
},{
text: '从 2.0.x 迁移到 3.0.x',
link: '/guide/upgrade3.md'
}
link: '/guide/mock.md',
},
{
text: '从 2.x 迁移到 3.x',
link: '/guide/upgrade3.md',
},
],
},
{
@ -55,102 +63,102 @@ export const zh = {
items: [
{
text: '使用图片',
link: '/guide/image.md'
link: '/guide/image.md',
},
{
text: '使用 css',
link: '/guide/css.md'
link: '/guide/css.md',
},
{
text: '静态资源',
link: '/guide/public.md'
}
link: '/guide/public.md',
},
],
},
{
text: '贡献指南',
link: '/guide/contributing.md'
link: '/guide/contributing.md',
},
{
text: '常见问题',
link: '/guide/faq.md'
link: '/guide/faq.md',
},
],
'/reference/plugin/': [
{
text: '介绍',
link: '/reference/plugin/index.md'
link: '/reference/plugin/index.md',
},
{
text: 'Plugins',
items: [
{
text: '@fesjs/plugin-access',
link: '/reference/plugin/plugins/access.md'
link: '/reference/plugin/plugins/access.md',
},
{
text: '@fesjs/plugin-enums',
link: '/reference/plugin/plugins/enums.md'
link: '/reference/plugin/plugins/enums.md',
},
{
text: '@fesjs/plugin-icon',
link: '/reference/plugin/plugins/icon.md'
link: '/reference/plugin/plugins/icon.md',
},
{
text: '@fesjs/plugin-jest',
link: '/reference/plugin/plugins/jest.md'
link: '/reference/plugin/plugins/jest.md',
},
{
text: '@fesjs/plugin-layout',
link: '/reference/plugin/plugins/layout.md'
link: '/reference/plugin/plugins/layout.md',
},
{
text: '@fesjs/plugin-locale',
link: '/reference/plugin/plugins/locale.md'
link: '/reference/plugin/plugins/locale.md',
},
{
text: '@fesjs/plugin-model',
link: '/reference/plugin/plugins/model.md'
link: '/reference/plugin/plugins/model.md',
},
{
text: '@fesjs/plugin-request',
link: '/reference/plugin/plugins/request.md'
link: '/reference/plugin/plugins/request.md',
},
{
text: '@fesjs/plugin-vuex',
link: '/reference/plugin/plugins/vuex.md'
link: '/reference/plugin/plugins/vuex.md',
},
{
text: '@fesjs/plugin-qiankun',
link: '/reference/plugin/plugins/qiankun.md'
link: '/reference/plugin/plugins/qiankun.md',
},
{
text: '@fesjs/plugin-windicss',
link: '/reference/plugin/plugins/windicss.md'
link: '/reference/plugin/plugins/windicss.md',
},
{
text: '@fesjs/plugin-sass',
link: '/reference/plugin/plugins/sass.md'
link: '/reference/plugin/plugins/sass.md',
},
{
text: '@fesjs/plugin-editor',
link: '/reference/plugin/plugins/editor.md'
link: '/reference/plugin/plugins/editor.md',
},
{
text: '@fesjs/plugin-pinia',
link: '/reference/plugin/plugins/pinia.md'
link: '/reference/plugin/plugins/pinia.md',
},
{
text: '@fesjs/plugin-watermark',
link: '/reference/plugin/plugins/watermark.md'
link: '/reference/plugin/plugins/watermark.md',
},
{
text: '@fesjs/plugin-login',
link: '/reference/plugin/plugins/login.md'
link: '/reference/plugin/plugins/login.md',
},
{
text: '@fesjs/plugin-swc',
link: '/reference/plugin/plugins/swc.md'
link: '/reference/plugin/plugins/swc.md',
},
],
},
@ -158,10 +166,10 @@ export const zh = {
text: '插件开发',
items: [{
text: '插件介绍',
link: '/reference/plugin/dev/index.md'
link: '/reference/plugin/dev/index.md',
}, {
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) 下。
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. [request 插件](../reference/plugin/plugins/request.md#_2-x-升级到-3-x) 有一些参数变更
3. [request 插件](../reference/plugin/plugins/request.md#_2-x-升级到-3-x) 有一些参数变更,升级请使用最新版本
## 继续使用 Webpack
1. 添加 Webpack 构建依赖包: `npm i @fesjs/builder-webpack -D`
2. 如果设置了 `publicPath: './'`,请更改为 `publicPath: ''`
3. 将 html 模版文件从 `public/index.html` 文件挪到项目根目录,移除 [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin) 相关配置,具体模版变量使用请查看[HTML 模版](../guide/template.html)。
2. `dev``publicPath` 配置不能为 `./`,请更改为 `auto`
3. 将 html 模版文件从 `public/index.html` 挪到项目根目录,移除 [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin) 相关配置,具体模版变量使用请查看[HTML 模版](../guide/template.html)。
## 换成 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-locale](../reference/plugin/plugins/locale.md) 需要升级到`4.0.x`版本。