Skip to content

Commit e086b1c

Browse files
release: v2.4.0
2 parents e727e85 + 76294d2 commit e086b1c

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

config/index.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,13 @@ export default async ({ command, mode }) => {
136136

137137
### publicDir {#publicdir}
138138

139-
- **类型:** `string`
139+
- **类型:** `string | false`
140140
- **默认:** `"public"`
141141

142142
作为静态资源服务的文件夹。该目录中的文件在开发期间在 `/` 处提供,并在构建期间复制到 `outDir` 的根目录,并且始终按原样提供或复制而无需进行转换。该值可以是文件系统的绝对路径,也可以是相对于项目的根目录的相对路径。
143143

144+
`publicDir` 设定为 `false` 可以关闭此项功能。
145+
144146
欲了解更多,请参阅 [`public` 目录](/guide/assets#the-public-directory)
145147

146148
### cacheDir {#cachedir}
@@ -282,7 +284,7 @@ export default async ({ command, mode }) => {
282284
}
283285
```
284286

285-
默认情况下,ESbuild 会被应用在 `ts``jsx``tsx` 文件。你可以通过 `esbuild.include``esbuild.exclude` 对其进行配置,它们两个配置的类型是`string | RegExp | (string | RegExp)[]`
287+
默认情况下,ESbuild 会被应用在 `ts``jsx``tsx` 文件。你可以通过 `esbuild.include``esbuild.exclude` 对要处理的文件类型进行配置,这两个配置的类型应为 `string | RegExp | (string | RegExp)[]`
286288

287289
此外,你还可以通过 `esbuild.jsxInject` 来自动为每一个被 ESbuild 转换的文件注入 JSX helper。
288290

@@ -413,7 +415,7 @@ export default async ({ command, mode }) => {
413415
changeOrigin: true,
414416
configure: (proxy, options) => {
415417
// proxy 是 'http-proxy' 的实例
416-
}),
418+
},
417419
}
418420
}
419421
}
@@ -630,7 +632,7 @@ createServer()
630632
- **默认:** `false`
631633
- **相关内容:** [后端集成](/guide/backend-integration)
632634

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

635637
### build.minify {#build-minify}
636638

guide/api-plugin.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ Vite 插件也可以提供钩子来服务于特定的 Vite 目标。这些钩子
150150
### `config` {#config}
151151

152152
- **类型:** `(config: UserConfig, env: { mode: string, command: string }) => UserConfig | null | void`
153-
- **种类:** `sync`, `sequential`
153+
- **种类:** `async`, `sequential`
154154

155155
在解析 Vite 配置前调用。钩子接收原始用户配置(命令行选项指定的会与配置文件合并)和一个描述配置环境的变量,包含正在使用的 `mode``command`。它可以返回一个将被深度合并到现有配置中的部分配置对象,或者直接改变配置(如果默认的合并不能达到预期的结果)。
156156

guide/assets.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,6 @@ function getImageUrl(name) {
105105
106106
在生产构建时,Vite 才会进行必要的转换保证 URL 在打包和资源哈希后仍指向正确的地址。
107107
108-
::: 警告 注意:无法在 SSR 中使用
108+
::: warning 注意:无法在 SSR 中使用
109109
如果你正在以服务端渲染模式使用 Vite 则此模式不支持,因为 `import.meta.url` 在浏览器和 Node.js 中有不同的语义。服务端的产物也无法预先确定客户端主机 URL。
110110
:::

guide/features.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ const modules = {
260260
- 该 Glob 模式会被当成导入标识符:必须是相对路径(以 `./` 开头)或绝对路径(以 `/` 开头,相对于项目根目录解析)。
261261
- Glob 匹配是使用 `fast-glob` 来实现的 —— 阅读它的文档来查阅 [支持的 Glob 模式](https://github.com/mrmlnc/fast-glob#pattern-syntax)
262262

263-
## Web Assembly {#web-assembly}
263+
## WebAssembly {#webassembly}
264264

265265
预编译的 `.wasm` 文件可以直接被导入 —— 默认导出一个函数,返回值为所导出 wasm 实例对象的 Promise:
266266

0 commit comments

Comments
 (0)