File tree 4 files changed +9
-7
lines changed
4 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -136,11 +136,13 @@ export default async ({ command, mode }) => {
136
136
137
137
### publicDir {#publicdir}
138
138
139
- - ** 类型:** ` string `
139
+ - ** 类型:** ` string | false `
140
140
- ** 默认:** ` "public" `
141
141
142
142
作为静态资源服务的文件夹。该目录中的文件在开发期间在 ` / ` 处提供,并在构建期间复制到 ` outDir ` 的根目录,并且始终按原样提供或复制而无需进行转换。该值可以是文件系统的绝对路径,也可以是相对于项目的根目录的相对路径。
143
143
144
+ 将 ` publicDir ` 设定为 ` false ` 可以关闭此项功能。
145
+
144
146
欲了解更多,请参阅 [ ` public ` 目录] ( /guide/assets#the-public-directory ) 。
145
147
146
148
### cacheDir {#cachedir}
@@ -282,7 +284,7 @@ export default async ({ command, mode }) => {
282
284
}
283
285
```
284
286
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)[] ` 。
286
288
287
289
此外,你还可以通过 ` esbuild.jsxInject ` 来自动为每一个被 ESbuild 转换的文件注入 JSX helper。
288
290
@@ -413,7 +415,7 @@ export default async ({ command, mode }) => {
413
415
changeOrigin: true ,
414
416
configure : (proxy , options ) => {
415
417
// proxy 是 'http-proxy' 的实例
416
- }) ,
418
+ },
417
419
}
418
420
}
419
421
}
@@ -630,7 +632,7 @@ createServer()
630
632
- ** 默认:** ` false `
631
633
- ** 相关内容:** [ 后端集成] ( /guide/backend-integration )
632
634
633
- 当设置为 ` true ` ,构建后将会生成 ` manifest.json ` 文件,映射没有被 hash 的资源文件名和它们的 hash 版本 。可以为一些服务器框架渲染时提供正确的资源引入链接。
635
+ 当设置为 ` true ` ,构建后将会生成 ` manifest.json ` 文件,包含了没有被 hash 的资源文件名和 hash 后版本的映射 。可以为一些服务器框架渲染时提供正确的资源引入链接。
634
636
635
637
### build.minify {#build-minify}
636
638
Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ Vite 插件也可以提供钩子来服务于特定的 Vite 目标。这些钩子
150
150
### ` config ` {#config}
151
151
152
152
- ** 类型:** ` (config: UserConfig, env: { mode: string, command: string }) => UserConfig | null | void `
153
- - ** 种类:** ` sync ` , ` sequential `
153
+ - ** 种类:** ` async ` , ` sequential `
154
154
155
155
在解析 Vite 配置前调用。钩子接收原始用户配置(命令行选项指定的会与配置文件合并)和一个描述配置环境的变量,包含正在使用的 ` mode ` 和 ` command ` 。它可以返回一个将被深度合并到现有配置中的部分配置对象,或者直接改变配置(如果默认的合并不能达到预期的结果)。
156
156
Original file line number Diff line number Diff line change @@ -105,6 +105,6 @@ function getImageUrl(name) {
105
105
106
106
在生产构建时,Vite 才会进行必要的转换保证 URL 在打包和资源哈希后仍指向正确的地址。
107
107
108
- ::: 警告 注意:无法在 SSR 中使用
108
+ ::: warning 注意:无法在 SSR 中使用
109
109
如果你正在以服务端渲染模式使用 Vite 则此模式不支持,因为 ` import .meta.url` 在浏览器和 Node.js 中有不同的语义。服务端的产物也无法预先确定客户端主机 URL。
110
110
:::
Original file line number Diff line number Diff line change @@ -260,7 +260,7 @@ const modules = {
260
260
- 该 Glob 模式会被当成导入标识符:必须是相对路径(以 ` ./ ` 开头)或绝对路径(以 ` / ` 开头,相对于项目根目录解析)。
261
261
- Glob 匹配是使用 ` fast-glob ` 来实现的 —— 阅读它的文档来查阅 [ 支持的 Glob 模式] ( https://github.com/mrmlnc/fast-glob#pattern-syntax ) 。
262
262
263
- ## Web Assembly {#web-assembly }
263
+ ## WebAssembly {#webassembly }
264
264
265
265
预编译的 ` .wasm ` 文件可以直接被导入 —— 默认导出一个函数,返回值为所导出 wasm 实例对象的 Promise:
266
266
You can’t perform that action at this time.
0 commit comments