From 105ecf7f39c320f04d3dc233429adb4a396c368c Mon Sep 17 00:00:00 2001 From: Deot Date: Mon, 4 Sep 2023 10:50:16 +0800 Subject: [PATCH 1/4] feat: export `server.bindCLIShortcuts` (#13675) --- guide/api-javascript.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/guide/api-javascript.md b/guide/api-javascript.md index a9a5a259..c320d537 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 }) })() ``` @@ -138,6 +139,10 @@ interface ViteDevServer { * Stop the server. */ close(): Promise + /** + * Bind CLI shortcuts + */ + bindCLIShortcuts(options?: BindCLIShortcutsOptions): void } ``` @@ -195,6 +200,7 @@ import { preview } from 'vite' }) previewServer.printUrls() + previewServer.bindCLIShortcuts({ print: true }) })() ``` @@ -228,6 +234,10 @@ interface PreviewServer { * Print server urls */ printUrls(): void + /** + * Bind CLI shortcuts + */ + bindCLIShortcuts(options?: BindCLIShortcutsOptions): void } ``` From 3c69a7501c301366e6ae1fda54b83bba94ccb313 Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Sun, 10 Sep 2023 20:56:32 +0800 Subject: [PATCH 2/4] chore(docs): `api-plugin` and `features` apply outline deep (#14282) --- guide/api-plugin.md | 4 ++++ guide/features.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/guide/api-plugin.md b/guide/api-plugin.md index d2f3b6ff..8d81c9c0 100644 --- a/guide/api-plugin.md +++ b/guide/api-plugin.md @@ -1,3 +1,7 @@ +--- +outline: [2, 3] +--- + # Plugin API Vite plugins extends Rollup's well-designed plugin interface with a few extra Vite-specific options. As a result, you can write a Vite plugin once and have it work for both dev and build. diff --git a/guide/features.md b/guide/features.md index 392bafb8..f4fdba95 100644 --- a/guide/features.md +++ b/guide/features.md @@ -1,3 +1,7 @@ +--- +outline: [2, 3] +--- + # Features At the very basic level, developing using Vite is not that much different from using a static file server. However, Vite provides many enhancements over native ESM imports to support various features that are typically seen in bundler-based setups. From f3a27d5f1d6cec1368307ef9e0c5e49c5bf95320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E9=9D=92=E5=B7=9D?= <46062972+ShenQingchuan@users.noreply.github.com> Date: Thu, 14 Sep 2023 10:47:24 +0800 Subject: [PATCH 3/4] Update api-plugin.md --- guide/api-plugin.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/guide/api-plugin.md b/guide/api-plugin.md index 3917b20e..5b3ea54f 100644 --- a/guide/api-plugin.md +++ b/guide/api-plugin.md @@ -1,12 +1,8 @@ -<<<<<<< HEAD -# 插件 API {#plugin-api} -======= --- outline: [2, 3] --- -# Plugin API ->>>>>>> 3c69a7501c301366e6ae1fda54b83bba94ccb313 +# 插件 API {#plugin-api} Vite 插件扩展了设计出色的 Rollup 接口,带有一些 Vite 独有的配置项。因此,你只需要编写一个 Vite 插件,就可以同时为开发环境和生产环境工作。 From afc84c553c59a340ae57a64a7271ef66e4e9dad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E9=9D=92=E5=B7=9D?= <46062972+ShenQingchuan@users.noreply.github.com> Date: Thu, 14 Sep 2023 10:56:42 +0800 Subject: [PATCH 4/4] Update features.md --- guide/features.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/guide/features.md b/guide/features.md index 30582aaf..f1088fdd 100644 --- a/guide/features.md +++ b/guide/features.md @@ -1,12 +1,8 @@ -<<<<<<< HEAD -# 功能 {#features} -======= --- outline: [2, 3] --- -# Features ->>>>>>> 3c69a7501c301366e6ae1fda54b83bba94ccb313 +# 功能 {#features} 对非常基础的使用来说,使用 Vite 开发和使用一个静态文件服务器并没有太大区别。然而,Vite 还通过原生 ESM 导入提供了许多主要用于打包场景的增强功能。