Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYNC] docs: config hook is async (#4075) #17

Closed
github-actions bot opened this issue Jul 3, 2021 · 0 comments · Fixed by #27
Closed

[SYNC] docs: config hook is async (#4075) #17

github-actions bot opened this issue Jul 3, 2021 · 0 comments · Fixed by #27
Labels

Comments

@github-actions
Copy link
Contributor

github-actions bot commented Jul 3, 2021

docs: config hook is async (#4075) (5c177db)


+++ 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

0 participants