diff --git a/guide/api-javascript.md b/guide/api-javascript.md index ffbd80c9..d69fc0b7 100644 --- a/guide/api-javascript.md +++ b/guide/api-javascript.md @@ -30,6 +30,7 @@ const __dirname = fileURLToPath(new URL('.', import.meta.url)) await server.listen() server.printUrls() + server.bindCLIShortcuts({ print: true }) })() ``` @@ -136,6 +137,10 @@ interface ViteDevServer { * 停止服务器 */ close(): Promise + /** + * Bind CLI shortcuts + */ + bindCLIShortcuts(options?: BindCLIShortcutsOptions): void } ``` @@ -193,6 +198,7 @@ import { preview } from 'vite' }) previewServer.printUrls() + previewServer.bindCLIShortcuts({ print: true }) })() ``` @@ -226,6 +232,10 @@ interface PreviewServer { * 打印服务器 URL */ printUrls(): void + /** + * Bind CLI shortcuts + */ + bindCLIShortcuts(options?: BindCLIShortcutsOptions): void } ``` diff --git a/guide/api-plugin.md b/guide/api-plugin.md index dbeb7e0a..5b3ea54f 100644 --- a/guide/api-plugin.md +++ b/guide/api-plugin.md @@ -1,3 +1,7 @@ +--- +outline: [2, 3] +--- + # 插件 API {#plugin-api} Vite 插件扩展了设计出色的 Rollup 接口,带有一些 Vite 独有的配置项。因此,你只需要编写一个 Vite 插件,就可以同时为开发环境和生产环境工作。 diff --git a/guide/features.md b/guide/features.md index 9143e1f4..f1088fdd 100644 --- a/guide/features.md +++ b/guide/features.md @@ -1,3 +1,7 @@ +--- +outline: [2, 3] +--- + # 功能 {#features} 对非常基础的使用来说,使用 Vite 开发和使用一个静态文件服务器并没有太大区别。然而,Vite 还通过原生 ESM 导入提供了许多主要用于打包场景的增强功能。