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: 3 additions & 7 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ const config = defineConfig({
darkModeSwitchTitle: '切换到深色模式',
variant: 'vite',
banner: {
id: 'cloudflare-supports-vite',
text: 'Cloudflare 支持 Vite 的使命',
url: '/blog/cloudflare-supports-vite',
id: 'viteconf-2026',
text: 'ViteConf 2026 - 10 月 15 日线上举办',
url: 'https://viteconf.org/',
},

editLink: {
Expand Down Expand Up @@ -536,10 +536,6 @@ const config = defineConfig({
vite: {
resolve: {
alias: {
'@components/oss/TopBanner.vue': path.resolve(
import.meta.dirname,
'theme/components/TopBanner.vue',
),
'@components/oss/TrustedBy.vue': path.resolve(
import.meta.dirname,
'theme/components/TrustedBy.vue',
Expand Down
10 changes: 3 additions & 7 deletions .vitepress/theme/components/AsideSponsors.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ const sponsors = computed(() => {
</script>

<template>
<a
class="viteconf"
href="https://www.youtube.com/playlist?list=PLqGQbXn_GDmkJaoykvHCUmXUPjhgH2bVr"
target="_blank"
>
<a class="viteconf" href="https://viteconf.org/" target="_blank">
<img
width="22"
height="22"
Expand All @@ -32,8 +28,8 @@ const sponsors = computed(() => {
/>
<span>
<p class="extra-info">Building Together</p>
<p class="heading">ViteConf 2025</p>
<p class="extra-info">View the replays</p>
<p class="heading">ViteConf 2026</p>
<p class="extra-info">October 15, Online</p>
</span>
</a>
<VPDocAsideSponsors v-if="data" :data="sponsors" />
Expand Down
7 changes: 7 additions & 0 deletions .vitepress/theme/components/SupportedVersions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@ function isValidViteVersion(version: string) {
transition: border-color 0.1s;
}

@supports (field-sizing: content) {
.checked-input {
width: auto;
field-sizing: content;
}
}

.checked-input:focus,
.checked-input:hover {
border-color: var(--vp-c-brand);
Expand Down
159 changes: 0 additions & 159 deletions .vitepress/theme/components/TopBanner.vue

This file was deleted.

2 changes: 2 additions & 0 deletions config/build-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ npm add -D esbuild

直接自定义底层 Rolldown 包。这与从 Rolldown 配置文件导出的选项相同,并将与 Vite 的内部 Rolldown 选项合并。更多详情请参阅 [Rolldown 选项文档](https://rolldown.rs/reference/)。

Vite 会覆盖 Rolldown 中 `preserveEntrySignatures` 的默认值。当此选项未设置时,Vite 对普通客户端构建使用 `false`,对库构建使用 `'strict'`,对 SSR 构建使用 `'allow-extension'`。

建议设置顶层 [`input`](/config/shared-options#input) 选项,而不是 `build.rolldownOptions.input`,因为顶层选项也会在开发期间使用。如果设置了 `build.rolldownOptions.input`,它将只在构建期间覆盖顶层 `input` 选项。

## build.rollupOptions {#build-rollupoptions}
Expand Down
10 changes: 5 additions & 5 deletions config/server-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -465,21 +465,21 @@ export default defineConfig({
## server.sourcemapIgnoreList {#server-sourcemapignorelist}

- **类型:** `false | (sourcePath: string, sourcemapPath: string) => boolean`
- **默认值:** `(sourcePath) => sourcePath.includes('node_modules')`
- **默认值:** `(sourcePath) => /(?:^|[\\/])node_modules(?:[\\/]|$)/.test(sourcePath)`

是否忽略服务器 sourcemap 中的源文件,用于填充 [`x_google_ignoreList` source map 扩展](https://developer.chrome.com/articles/x-google-ignore-list/)。

对开发服务器来说,`server.sourcemapIgnoreList` 等价于 [`build.rolldownOptions.output.sourcemapIgnoreList`](https://rolldown.rs/reference/OutputOptions.sourcemapIgnoreList)。两个配置选项之间的区别在于,Rolldown 函数使用相对路径调用 `sourcePath`,而 `server.sourcemapIgnoreList` 使用绝对路径调用。在开发过程中,大多数模块的映射和源文件位于同一个文件夹中,因此 `sourcePath` 的相对路径就是文件名本身。在这些情况下,使用绝对路径更加方便。

默认情况下,它会排除所有包含 `node_modules` 的路径。你可以传递 `false` 来禁用此行为,或者为了获得完全的控制,可以传递一个函数,该函数接受源路径和 sourcemap 的路径,并返回是否忽略源路径。
默认情况下,它会排除所有将 `node_modules` 作为路径段包含的路径。你可以传递 `false` 来禁用此行为,或者为了获得完全的控制,可以传递一个函数,该函数接受源路径和 sourcemap 的路径,并返回是否忽略源路径。

```js
export default defineConfig({
server: {
// 这是默认值,它将把所有路径中含有 node_modules 的文件
// 添加到忽略列表中。
// 这是默认值,它将把所有路径中包含 node_modules 路径段
// 的文件添加到忽略列表中。
sourcemapIgnoreList(sourcePath, sourcemapPath) {
return sourcePath.includes('node_modules')
return /(?:^|[\\/])node_modules(?:[\\/]|$)/.test(sourcePath)
},
},
})
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "vite-docs-cn",
"version": "8.3.0",
"version": "8.3.1",
"description": "Vite.js documentation Chinese translation.",
"repository": "https://github.com/vitejs/docs-cn",
"type": "module",
"author": "Evan You",
"private": true,
"license": "CC BY-NC-SA 4.0",
"devDependencies": {
"@iconify/vue": "^5.0.1",
"@iconify/vue": "^5.0.3",
"@shikijs/vitepress-twoslash": "^4.4.3",
"@type-challenges/utils": "^0.1.1",
"@types/express": "^5.0.6",
"@types/node": "^25.0.10",
"@voidzero-dev/vitepress-theme": "^5.0.6",
"@voidzero-dev/vitepress-theme": "^5.0.7",
"chalk": "^5.6.2",
"feed": "^6.0.0",
"gray-matter": "^4.0.3",
Expand All @@ -23,7 +23,7 @@
"vitepress": "^2.0.0-alpha.20",
"vitepress-plugin-graphviz": "^0.1.0",
"vitepress-plugin-group-icons": "^1.7.6",
"vue": "^3.5.42",
"vue": "^3.5.43",
"vue-tsc": "^3.3.11",
"yorkie": "^2.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion plugins/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ npm create vite@latest -- --template rsc

查看 [Vite 插件注册表](https://registry.vite.dev/plugins) 获取发布到 npm 的插件列表。

## Rolldown 内置插件 {#rolldown-builtin-plugins}
## Rolldown 内置插件 {#rolldown-built-in-plugins}

Vite 在底层使用 [Rolldown](https://rolldown.rs/),它为常见用例提供了一些内置插件。

Expand Down
Loading