You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
+++ b/docs/config/index.md@@ -15,7 +15,7 @@ export default {
}
```
-Note Vite supports using ES modules syntax in the config file even if the project is not using native Node ESM via `type: "module"`. In this case the config file is auto pre-processed before load.+Note Vite supports using ES modules syntax in the config file even if the project is not using native Node ESM via `type: "module"`. In this case, the config file is auto pre-processed before load.
You can also explicitly specify a config file to use with the `--config` CLI option (resolved relative to `cwd`):
@@ -38,7 +38,7 @@ const config = {
export default config
```
-Alternatively you can use the `defineConfig` helper which should provide intellisense without the need for jsdoc annotations:+Alternatively, you can use the `defineConfig` helper which should provide intellisense without the need for jsdoc annotations:
```js
import { defineConfig } from 'vite'
@@ -88,7 +88,7 @@ export default async ({ command, mode }) => {
- **Type:** `string`- **Default:** `process.cwd()`- Project root directory (where `index.html` is located). Can be an absolute path, or a path relative from the location of the config file itself.+ Project root directory (where `index.html` is located). Can be an absolute path, or a path relative to the location of the config file itself.
See [Project Root](/guide/#index-html-and-project-root) for more details.
@@ -124,7 +124,7 @@ export default async ({ command, mode }) => {
- Replacements are performed only when the match is surrounded by word boundaries (`\b`).- Because it's implemented as straightforward text replacements without any syntax analyzation, we recommend using `define` for CONSTANTS only.+ Because it's implemented as straightforward text replacements without any syntax analysis, we recommend using `define` for CONSTANTS only.
For example, `process.env.FOO` and `__APP_VERSION__` are good fits. But `process` or `global` should not be put into this option. Variables can be shimmed or polyfilled instead.
@@ -136,11 +136,13 @@ export default async ({ command, mode }) => {
### publicDir-- **Type:** `string`+- **Type:** `string | false`- **Default:** `"public"`
Directory to serve as plain static assets. Files in this directory are served at `/` during dev and copied to the root of `outDir` during build, and are always served or copied as-is without transform. The value can be either an absolute file system path or a path relative to project root.
+ Defining `publicDir` as `false` disables this feature.+
See [The `public` Directory](/guide/assets#the-public-directory) for more details.
### cacheDir@@ -148,7 +150,7 @@ export default async ({ command, mode }) => {
- **Type:** `string`- **Default:** `"node_modules/.vite"`- Directory to save cache files. Files in this directory are pre-bundled deps or some other cache files that generated by vite, which can improve the performance. You can use `--force` flag or manually delete the directory to regenerate the cache files. The value can be either an absolute file system path or a path relative to project root.+ Directory to save cache files. Files in this directory are pre-bundled deps or some other cache files generated by vite, which can improve the performance. You can use `--force` flag or manually delete the directory to regenerate the cache files. The value can be either an absolute file system path or a path relative to project root.### resolve.alias@@ -282,7 +284,7 @@ export default async ({ command, mode }) => {
}
```
- By default, ESBuild is applied to `ts`, `jsx` and `tsx` files. You can customize this with `esbuild.include` and `esbuild.exclude`, both of which expects type of `string | RegExp | (string | RegExp)[]`.+ By default, ESBuild is applied to `ts`, `jsx` and `tsx` files. You can customize this with `esbuild.include` and `esbuild.exclude`, both of which expect type of `string | RegExp | (string | RegExp)[]`.
In addition, you can also use `esbuild.jsxInject` to automatically inject JSX helper imports for every file transformed by ESBuild:
@@ -632,14 +634,14 @@ createServer()
- **Default:** `false`- **Related:** [Backend Integration](/guide/backend-integration)- When set to `true`, the build will also generate a `manifest.json` file that contains mapping of non-hashed asset filenames to their hashed versions, which can then be used by a server framework to render the correct asset links.+ When set to `true`, the build will also generate a `manifest.json` file that contains a mapping of non-hashed asset filenames to their hashed versions, which can then be used by a server framework to render the correct asset links.### build.minify- **Type:** `boolean | 'terser' | 'esbuild'`- **Default:** `'terser'`- Set to `false` to disable minification, or specify the minifier to use. The default is [Terser](https://github.com/terser/terser) which is slower but produces smaller bundles in most cases. Esbuild minification is significantly faster, but will result in slightly larger bundles.+ Set to `false` to disable minification, or specify the minifier to use. The default is [Terser](https://github.com/terser/terser) which is slower but produces smaller bundles in most cases. Esbuild minification is significantly faster but will result in slightly larger bundles.### build.terserOptions
The text was updated successfully, but these errors were encountered:
docs: config hook is async (#4075) (5c177db)
The text was updated successfully, but these errors were encountered: