Skip to content

Commit 0105efb

Browse files
authored
docs(en): merge docs-cn/sync-docs into docs-cn/dev @ f6ebf96
2 parents 2237565 + 57c3a27 commit 0105efb

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed

config/index.md

+8
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,14 @@ createServer()
662662

663663
当设置为 `true`,构建后将会生成 `manifest.json` 文件,包含了没有被 hash 的资源文件名和 hash 后版本的映射。可以为一些服务器框架渲染时提供正确的资源引入链接。
664664

665+
### build.ssrManifest {#build-ssrmanifest}
666+
667+
- **类型:** `boolean`
668+
- **默认值:** `false`
669+
- **相关链接:** [Server-Side Rendering](/guide/ssr)
670+
671+
当设置为 `true` 时,构建也将生成 SSR 的 manifest 文件,以确定生产中的样式链接与资产预加载指令。
672+
665673
### build.minify {#build-minify}
666674

667675
- **类型:** `boolean | 'terser' | 'esbuild'`

guide/api-javascript.md

+13-10
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,6 @@ interface ViteDevServer {
8585
* 应用 Vite 内建 HTML 转换和任意插件 HTML 转换
8686
*/
8787
transformIndexHtml(url: string, html: string): Promise<string>
88-
/**
89-
* 使用 esbuild 转换一个文件的工具函数
90-
* 对某些特定插件十分有用
91-
*/
92-
transformWithEsbuild(
93-
code: string,
94-
filename: string,
95-
options?: EsbuildTransformOptions,
96-
inMap?: object
97-
): Promise<ESBuildTransformResult>
9888
/**
9989
* 加载一个给定的 URL 作为 SSR 的实例化模块
10090
*/
@@ -157,3 +147,16 @@ async function resolveConfig(
157147
defaultMode?: string
158148
): Promise<ResolvedConfig>
159149
```
150+
151+
## `transformWithEsbuild`
152+
153+
**类型签名:**
154+
155+
```ts
156+
async function transformWithEsbuild(
157+
code: string,
158+
filename: string,
159+
options?: EsbuildTransformOptions,
160+
inMap?: object
161+
): Promise<ESBuildTransformResult>
162+
```

0 commit comments

Comments
 (0)