Skip to content

Commit 201c9a0

Browse files
authored
docs: fix broken links (#8655)
1 parent 817aea1 commit 201c9a0

12 files changed

+31
-31
lines changed

docs/config/build-options.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ If you specify `build.lib`, `build.cssCodeSplit` will be `false` as default.
7373
## build.cssTarget
7474

7575
- **Type:** `string | string[]`
76-
- **Default:** the same as [`build.target`](/config/#build-target)
76+
- **Default:** the same as [`build.target`](#build-target)
7777

7878
This options allows users to set a different browser target for CSS minification from the one used for JavaScript transpilation.
7979

docs/config/preview-options.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ The value can also be an [options object](https://nodejs.org/api/https.html#http
5656
## preview.open
5757

5858
- **Type:** `boolean | string`
59-
- **Default:** [`server.open`](./server-options#server_open)
59+
- **Default:** [`server.open`](./server-options#server-open)
6060

6161
Automatically open the app in the browser on server start. When the value is a string, it will be used as the URL's pathname. If you want to open the server in a specific browser you like, you can set the env `process.env.BROWSER` (e.g. `firefox`). See [the `open` package](https://github.com/sindresorhus/open#app) for more details.
6262

6363
## preview.proxy
6464

6565
- **Type:** `Record<string, string | ProxyOptions>`
66-
- **Default:** [`server.proxy`](./server-options#server_proxy)
66+
- **Default:** [`server.proxy`](./server-options#server-proxy)
6767

6868
Configure custom proxy rules for the dev server. Expects an object of `{ key: options }` pairs. If the key starts with `^`, it will be interpreted as a `RegExp`. The `configure` option can be used to access the proxy instance.
6969

@@ -72,6 +72,6 @@ Uses [`http-proxy`](https://github.com/http-party/node-http-proxy). Full options
7272
## preview.cors
7373

7474
- **Type:** `boolean | CorsOptions`
75-
- **Default:** [`server.cors`](./server-options#server_proxy)
75+
- **Default:** [`server.cors`](./server-options#server-cors)
7676

7777
Configure CORS for the dev server. This is enabled by default and allows any origin. Pass an [options object](https://github.com/expressjs/cors) to fine tune the behavior or `false` to disable.

docs/config/server-options.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ There are cases when other servers might respond instead of Vite.
1616

1717
The first case is when `localhost` is used. Node.js below v17 reorders the result of DNS-resolved address by default. When accessing `localhost`, browsers use DNS to resolve the address and that address might differ from the address which Vite is listening.
1818

19-
You could set [`dns.setDefaultResultOrder('verbatim')`](https://nodejs.org/docs/latest-v18.x/api/dns.html#dnssetdefaultresultorderorder) to disable the reordering behavior. Or you could set `server.host` to `127.0.0.1` explicitly.
19+
You could set [`dns.setDefaultResultOrder('verbatim')`](https://nodejs.org/api/dns.html#dns_dns_setdefaultresultorder_order) to disable the reordering behavior. Or you could set `server.host` to `127.0.0.1` explicitly.
2020

2121
```js
2222
// vite.config.js

docs/config/shared-options.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -347,4 +347,4 @@ Whether your application is a Single Page Application (SPA), a [Multi Page Appli
347347
- `'mpa'`: only include non-SPA HTML middlewares
348348
- `'custom'`: don't include HTML middlewares
349349

350-
Learn more in Vite's [SSR guide](/guide/ssr#vite-cli). Related: [`server.middlewareMode`](./server-options#servermiddlewaremode).
350+
Learn more in Vite's [SSR guide](/guide/ssr#vite-cli). Related: [`server.middlewareMode`](./server-options#server-middlewaremode).

docs/guide/assets.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Static Asset Handling
22

33
- Related: [Public Base Path](./build#public-base-path)
4-
- Related: [`assetsInclude` config option](/config/#assetsinclude)
4+
- Related: [`assetsInclude` config option](/config/shared-options.md#assetsinclude)
55

66
## Importing Asset as URL
77

@@ -20,11 +20,11 @@ The behavior is similar to webpack's `file-loader`. The difference is that the i
2020

2121
- If using the Vue plugin, asset references in Vue SFC templates are automatically converted into imports.
2222

23-
- Common image, media, and font filetypes are detected as assets automatically. You can extend the internal list using the [`assetsInclude` option](/config/#assetsinclude).
23+
- Common image, media, and font filetypes are detected as assets automatically. You can extend the internal list using the [`assetsInclude` option](/config/shared-options.md#assetsinclude).
2424

2525
- Referenced assets are included as part of the build assets graph, will get hashed file names, and can be processed by plugins for optimization.
2626

27-
- Assets smaller in bytes than the [`assetsInlineLimit` option](/config/#build-assetsinlinelimit) will be inlined as base64 data URLs.
27+
- Assets smaller in bytes than the [`assetsInlineLimit` option](/config/build-options.md#build-assetsinlinelimit) will be inlined as base64 data URLs.
2828

2929
### Explicit URL Imports
3030

@@ -76,7 +76,7 @@ If you have assets that are:
7676

7777
Then you can place the asset in a special `public` directory under your project root. Assets in this directory will be served at root path `/` during dev, and copied to the root of the dist directory as-is.
7878

79-
The directory defaults to `<root>/public`, but can be configured via the [`publicDir` option](/config/#publicdir).
79+
The directory defaults to `<root>/public`, but can be configured via the [`publicDir` option](/config/shared-options.md#publicdir).
8080

8181
Note that:
8282

@@ -115,5 +115,5 @@ This pattern does not work if you are using Vite for Server-Side Rendering, beca
115115
:::
116116
117117
::: warning `target` needs to be `es2020` or higher
118-
This pattern will not work if [build-target](https://vitejs.dev/config/#build-target) or [optimizedeps.esbuildoptions.target](https://vitejs.dev/config/#optimizedeps-esbuildoptions) is set to a value lower than `es2020`.
118+
This pattern will not work if [build-target](/config/build-options.md#build-target) or [optimizedeps.esbuildoptions.target](/config/dep-optimization-options.md#optimizedeps-esbuildoptions) is set to a value lower than `es2020`.
119119
:::

docs/guide/backend-integration.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ If you need a custom integration, you can follow the steps in this guide to conf
2222
})
2323
```
2424

25-
If you haven't disabled the [module preload polyfill](/config/#build-polyfillmodulepreload), you also need to import the polyfill in your entry
25+
If you haven't disabled the [module preload polyfill](/config/build-options.md#build-polyfillmodulepreload), you also need to import the polyfill in your entry
2626

2727
```js
2828
// add the beginning of your app entry
@@ -39,7 +39,7 @@ If you need a custom integration, you can follow the steps in this guide to conf
3939
In order to properly serve assets, you have two options:
4040

4141
- Make sure the server is configured to proxy static assets requests to the Vite server
42-
- Set [`server.origin`](https://vitejs.dev/config/#server-origin) so that generated asset URLs will be resolved using the back-end server URL instead of a relative path
42+
- Set [`server.origin`](/config/server-options.md#server-origin) so that generated asset URLs will be resolved using the back-end server URL instead of a relative path
4343

4444
This is needed for assets such as images to load properly.
4545

docs/guide/build.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The production bundle assumes support for modern JavaScript. By default, Vite ta
1111
- Safari >=13
1212
- Edge >=88
1313

14-
You can specify custom targets via the [`build.target` config option](/config/#build-target), where the lowest target is `es2015`.
14+
You can specify custom targets via the [`build.target` config option](/config/build-options.md#build-target), where the lowest target is `es2015`.
1515

1616
Note that by default, Vite only handles syntax transforms and **does not cover polyfills by default**. You can check out [Polyfill.io](https://polyfill.io/v3/) which is a service that automatically generates polyfill bundles based on the user's browser UserAgent string.
1717

@@ -21,15 +21,15 @@ Legacy browsers can be supported via [@vitejs/plugin-legacy](https://github.com/
2121

2222
- Related: [Asset Handling](./assets)
2323

24-
If you are deploying your project under a nested public path, simply specify the [`base` config option](/config/#base) and all asset paths will be rewritten accordingly. This option can also be specified as a command line flag, e.g. `vite build --base=/my/public/path/`.
24+
If you are deploying your project under a nested public path, simply specify the [`base` config option](/config/shared-options.md#base) and all asset paths will be rewritten accordingly. This option can also be specified as a command line flag, e.g. `vite build --base=/my/public/path/`.
2525

2626
JS-imported asset URLs, CSS `url()` references, and asset references in your `.html` files are all automatically adjusted to respect this option during build.
2727

2828
The exception is when you need to dynamically concatenate URLs on the fly. In this case, you can use the globally injected `import.meta.env.BASE_URL` variable which will be the public base path. Note this variable is statically replaced during build so it must appear exactly as-is (i.e. `import.meta.env['BASE_URL']` won't work).
2929

3030
## Customizing the Build
3131

32-
The build can be customized via various [build config options](/config/#build-options). Specifically, you can directly adjust the underlying [Rollup options](https://rollupjs.org/guide/en/#big-list-of-options) via `build.rollupOptions`:
32+
The build can be customized via various [build config options](/config/build-options.md). Specifically, you can directly adjust the underlying [Rollup options](https://rollupjs.org/guide/en/#big-list-of-options) via `build.rollupOptions`:
3333

3434
```js
3535
// vite.config.js
@@ -116,7 +116,7 @@ If you specify a different root, remember that `__dirname` will still be the fol
116116

117117
When you are developing a browser-oriented library, you are likely spending most of the time on a test/demo page that imports your actual library. With Vite, you can use your `index.html` for that purpose to get the smooth development experience.
118118

119-
When it is time to bundle your library for distribution, use the [`build.lib` config option](/config/#build-lib). Make sure to also externalize any dependencies that you do not want to bundle into your library, e.g. `vue` or `react`:
119+
When it is time to bundle your library for distribution, use the [`build.lib` config option](/config/build-options.md#build-lib). Make sure to also externalize any dependencies that you do not want to bundle into your library, e.g. `vue` or `react`:
120120

121121
```js
122122
// vite.config.js

docs/guide/dep-pre-bundling.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ After the server has already started, if a new dependency import is encountered
4242

4343
In a monorepo setup, a dependency may be a linked package from the same repo. Vite automatically detects dependencies that are not resolved from `node_modules` and treats the linked dep as source code. It will not attempt to bundle the linked dep, and will analyze the linked dep's dependency list instead.
4444

45-
However, this requires the linked dep to be exported as ESM. If not, you can add the dependency to [`optimizeDeps.include`](/config/#optimizedeps-include) and [`build.commonjsOptions.include`](/config/#build-commonjsoptions) in your config.
45+
However, this requires the linked dep to be exported as ESM. If not, you can add the dependency to [`optimizeDeps.include`](/config/dep-optimization-options.md#optimizedeps-include) and [`build.commonjsOptions.include`](/config/build-options.md#build-commonjsoptions) in your config.
4646

4747
```js
4848
export default defineConfig({
@@ -65,7 +65,7 @@ Due to differences in linked dependency resolution, transitive dependencies can
6565

6666
## Customizing the Behavior
6767

68-
The default dependency discovery heuristics may not always be desirable. In cases where you want to explicitly include/exclude dependencies from the list, use the [`optimizeDeps` config options](/config/#dep-optimization-options).
68+
The default dependency discovery heuristics may not always be desirable. In cases where you want to explicitly include/exclude dependencies from the list, use the [`optimizeDeps` config options](/config/dep-optimization-options.md).
6969

7070
A typical use case for `optimizeDeps.include` or `optimizeDeps.exclude` is when you have an import that is not directly discoverable in the source code. For example, maybe the import is created as a result of a plugin transform. This means Vite won't be able to discover the import on the initial scan - it can only discover it after the file is requested by the browser and transformed. This will cause the server to immediately re-bundle after server start.
7171

docs/guide/env-and-mode.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Vite exposes env variables on the special **`import.meta.env`** object. Some bui
66

77
- **`import.meta.env.MODE`**: {string} the [mode](#modes) the app is running in.
88

9-
- **`import.meta.env.BASE_URL`**: {string} the base url the app is being served from. This is determined by the [`base` config option](/config/#base).
9+
- **`import.meta.env.BASE_URL`**: {string} the base url the app is being served from. This is determined by the [`base` config option](/config/shared-options.md#base).
1010

1111
- **`import.meta.env.PROD`**: {boolean} whether the app is running in production.
1212

@@ -24,7 +24,7 @@ It will also replace these strings appearing in JavaScript strings and Vue templ
2424

2525
## `.env` Files
2626

27-
Vite uses [dotenv](https://github.com/motdotla/dotenv) to load additional environment variables from the following files in your [environment directory](/config/#envdir):
27+
Vite uses [dotenv](https://github.com/motdotla/dotenv) to load additional environment variables from the following files in your [environment directory](/config/shared-options.md#envdir):
2828

2929
```
3030
.env # loaded in all cases

docs/guide/features.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Vite provides first-class Vue support:
116116

117117
Vue users should use the official [@vitejs/plugin-vue-jsx](https://github.com/vitejs/vite/tree/main/packages/plugin-vue-jsx) plugin, which provides Vue 3 specific features including HMR, global component resolving, directives and slots.
118118

119-
If not using JSX with React or Vue, custom `jsxFactory` and `jsxFragment` can be configured using the [`esbuild` option](/config/#esbuild). For example for Preact:
119+
If not using JSX with React or Vue, custom `jsxFactory` and `jsxFragment` can be configured using the [`esbuild` option](/config/shared-options.md#esbuild). For example for Preact:
120120

121121
```js
122122
// vite.config.js
@@ -175,7 +175,7 @@ import classes from './example.module.css'
175175
document.getElementById('foo').className = classes.red
176176
```
177177

178-
CSS modules behavior can be configured via the [`css.modules` option](/config/#css-modules).
178+
CSS modules behavior can be configured via the [`css.modules` option](/config/shared-options.md#css-modules).
179179

180180
If `css.modules.localsConvention` is set to enable camelCase locals (e.g. `localsConvention: 'camelCaseOnly'`), you can also use named imports:
181181

@@ -428,7 +428,7 @@ const modules = {
428428
Note that:
429429

430430
- This is a Vite-only feature and is not a web or ES standard.
431-
- The glob patterns are treated like import specifiers: they must be either relative (start with `./`) or absolute (start with `/`, resolved relative to project root) or an alias path (see [`resolve.alias` option](/config/#resolve-alias)).
431+
- The glob patterns are treated like import specifiers: they must be either relative (start with `./`) or absolute (start with `/`, resolved relative to project root) or an alias path (see [`resolve.alias` option](/config/shared-options.md#resolve-alias)).
432432
- The glob matching is done via [`fast-glob`](https://github.com/mrmlnc/fast-glob) - check out its documentation for [supported glob patterns](https://github.com/mrmlnc/fast-glob#pattern-syntax).
433433
- You should also be aware that all the arguments in the `import.meta.glob` must be **passed as literals**. You can NOT use variables or expressions in them.
434434

@@ -517,7 +517,7 @@ If you wish to retrieve the worker as a URL, add the `url` query:
517517
import MyWorker from './worker?worker&url'
518518
```
519519

520-
See [Worker Options](/config/#worker-options) for details on configuring the bundling of all workers.
520+
See [Worker Options](/config/worker-options.md) for details on configuring the bundling of all workers.
521521

522522
## Build Optimizations
523523

@@ -527,7 +527,7 @@ See [Worker Options](/config/#worker-options) for details on configuring the bun
527527

528528
Vite automatically extracts the CSS used by modules in an async chunk and generates a separate file for it. The CSS file is automatically loaded via a `<link>` tag when the associated async chunk is loaded, and the async chunk is guaranteed to only be evaluated after the CSS is loaded to avoid [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content#:~:text=A%20flash%20of%20unstyled%20content,before%20all%20information%20is%20retrieved.).
529529

530-
If you'd rather have all the CSS extracted into a single file, you can disable CSS code splitting by setting [`build.cssCodeSplit`](/config/#build-csscodesplit) to `false`.
530+
If you'd rather have all the CSS extracted into a single file, you can disable CSS code splitting by setting [`build.cssCodeSplit`](/config/build-options.md#build-csscodesplit) to `false`.
531531

532532
### Preload Directives Generation
533533

docs/guide/migration.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ A small fraction of users will now require using [@vitejs/plugin-legacy](https:/
1919

2020
- The following options that were already deprecated in v2 have been removed:
2121

22-
- `alias` (switch to [`resolve.alias`](../config/shared-options.md#resolvealias))
23-
- `dedupe` (switch to [`resolve.dedupe`](../config/shared-options.md#resolvededupe))
22+
- `alias` (switch to [`resolve.alias`](../config/shared-options.md#resolve-alias))
23+
- `dedupe` (switch to [`resolve.dedupe`](../config/shared-options.md#resolve-dedupe))
2424
- `build.base` (switch to [`base`](../config/shared-options.md#base))
2525
- `build.brotliSize` (switch to [`build.reportCompressedSize`](../config/build-options.md#build-reportcompressedsize))
2626
- `build.cleanCssOptions` (Vite now uses esbuild for CSS minification)
2727
- `build.polyfillDynamicImport` (use [`@vitejs/plugin-legacy`](https://github.com/vitejs/vite/tree/main/packages/plugin-legacy) for browsers without dynamic import support)
28-
- `optimizeDeps.keepNames` (switch to [`optimizeDeps.esbuildOptions.keepNames`](../config/dep-optimization-options.md#optimizedepsesbuildoptions))
28+
- `optimizeDeps.keepNames` (switch to [`optimizeDeps.esbuildOptions.keepNames`](../config/dep-optimization-options.md#optimizedeps-esbuildoptions))
2929

3030
## Achitecture changes and legacy Options
3131

@@ -58,7 +58,7 @@ If you need to get back to the v2 strategy, you can use `legacy.buildRollupPlugi
5858

5959
### SSR Changes
6060

61-
Vite v3 uses ESM for the SSR build by default. When using ESM, the [SSR externalization heuristics](https://vitejs.dev/guide/ssr.html#ssr-externals) are no longer needed. By default, all dependencies are externalized. You can use [`ssr.noExternal`](../config/ssr-options.md#ssrnoexternal) to control what dependencies to include in the SSR bundle.
61+
Vite v3 uses ESM for the SSR build by default. When using ESM, the [SSR externalization heuristics](https://vitejs.dev/guide/ssr.html#ssr-externals) are no longer needed. By default, all dependencies are externalized. You can use [`ssr.noExternal`](../config/ssr-options.md#ssr-noexternal) to control what dependencies to include in the SSR bundle.
6262

6363
If using ESM for SSR isn't possible in your project, you can set `legacy.buildSsrCjsExternalHeuristics` to generate a CJS bundle using the same externalization strategy of Vite v2.
6464

docs/guide/static-deploy.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The following guides are based on some shared assumptions:
44

5-
- You are using the default build output location (`dist`). This location [can be changed using `build.outDir`](https://vitejs.dev/config/#build-outdir), and you can extrapolate instructions from these guides in that case.
5+
- You are using the default build output location (`dist`). This location [can be changed using `build.outDir`](/config/build-options.md#build-outdir), and you can extrapolate instructions from these guides in that case.
66
- You are using npm. You can use equivalent commands to run the scripts if you are using Yarn or other package managers.
77
- Vite is installed as a local dev dependency in your project, and you have setup the following npm scripts:
88

0 commit comments

Comments
 (0)