From ad22da1b7468d286599228b4bf001aa93bc4d53f Mon Sep 17 00:00:00 2001 From: ryomahan Date: Tue, 26 Dec 2023 18:50:10 +0800 Subject: [PATCH] docs: perfect README.md for the UserOptions of viteNext (#139) --- README.md | 19 ++++++++++++------- README.zh_CN.md | 19 ++++++++++++------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 7b8f43d..75f27bb 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,10 @@ export default defineConfig({ }, ], }, + /** + * If you are using vite that version higher than 5.0.0-beta.13, you can set viteNext to true to align vite's config + */ + viteNext: false, }), ], }) @@ -150,13 +154,14 @@ export default defineConfig({ ### UserOptions -| Parameter | Types | Default | Description | -| --------- | ------------------------ | ------------- | ----------------------------- | -| entry | `string` | `src/main.ts` | entry file path | -| template | `string` | `index.html` | relative path to the template | -| inject | `InjectOptions` | - | Data injected into HTML | -| minify | `boolean|MinifyOptions` | - | whether to compress html | -| pages | `PageOption` | - | Multi-page configuration | +| Parameter | Types | Default | Description | +| --------- | ------------------------ | ------------- | ------------------------------------------------- | +| entry | `string` | `src/main.ts` | entry file path | +| template | `string` | `index.html` | relative path to the template | +| inject | `InjectOptions` | - | Data injected into HTML | +| minify | `boolean|MinifyOptions` | - | whether to compress html | +| pages | `PageOption` | - | Multi-page configuration | +| viteNext | `boolean` | false | set to true to support the latest version of vite | ### InjectOptions diff --git a/README.zh_CN.md b/README.zh_CN.md index fde5518..771211c 100644 --- a/README.zh_CN.md +++ b/README.zh_CN.md @@ -84,6 +84,10 @@ export default defineConfig({ }, ], }, + /** + * 如果你使用的 vite 版本高于 5.0.0-beta.13,可以将 viteNext 设置为 true 来进行兼容 + */ + viteNext: false, }), ], }) @@ -152,13 +156,14 @@ export default defineConfig({ ### UserOptions -| 参数 | 类型 | 默认值 | 说明 | -| -------- | ------------------------ | ------------- | ---------------- | -| entry | `string` | `src/main.ts` | 入口文件 | -| template | `string` | `index.html` | 模板的相对路径 | -| inject | `InjectOptions` | - | 注入 HTML 的数据 | -| minify | `boolean|MinifyOptions` | - | 是否压缩 html | -| pages | `PageOption` | - | 多页配置 | +| 参数 | 类型 | 默认值 | 说明 | +| -------- | ------------------------ | ------------- | ------------------------------- | +| entry | `string` | `src/main.ts` | 入口文件 | +| template | `string` | `index.html` | 模板的相对路径 | +| inject | `InjectOptions` | - | 注入 HTML 的数据 | +| minify | `boolean|MinifyOptions` | - | 是否压缩 html | +| pages | `PageOption` | - | 多页配置 | +| viteNext | `boolean` | false | 用于开启是否兼容最新版本的 vite | ### InjectOptions