Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions guide/api-javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const __dirname = fileURLToPath(new URL('.', import.meta.url))
await server.listen()

server.printUrls()
server.bindCLIShortcuts({ print: true })
})()
```

Expand Down Expand Up @@ -136,6 +137,10 @@ interface ViteDevServer {
* 停止服务器
*/
close(): Promise<void>
/**
* Bind CLI shortcuts
*/
bindCLIShortcuts(options?: BindCLIShortcutsOptions<ViteDevServer>): void
}
```

Expand Down Expand Up @@ -193,6 +198,7 @@ import { preview } from 'vite'
})

previewServer.printUrls()
previewServer.bindCLIShortcuts({ print: true })
})()
```

Expand Down Expand Up @@ -226,6 +232,10 @@ interface PreviewServer {
* 打印服务器 URL
*/
printUrls(): void
/**
* Bind CLI shortcuts
*/
bindCLIShortcuts(options?: BindCLIShortcutsOptions<PreviewServer>): void
}
```

Expand Down
4 changes: 4 additions & 0 deletions guide/api-plugin.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
outline: [2, 3]
---

# 插件 API {#plugin-api}

Vite 插件扩展了设计出色的 Rollup 接口,带有一些 Vite 独有的配置项。因此,你只需要编写一个 Vite 插件,就可以同时为开发环境和生产环境工作。
Expand Down
4 changes: 4 additions & 0 deletions guide/features.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
outline: [2, 3]
---

# 功能 {#features}

对非常基础的使用来说,使用 Vite 开发和使用一个静态文件服务器并没有太大区别。然而,Vite 还通过原生 ESM 导入提供了许多主要用于打包场景的增强功能。
Expand Down