From 6e4034aa1d7c3284ed37c8200864882d99632935 Mon Sep 17 00:00:00 2001 From: patak-js Date: Fri, 2 Jul 2021 10:56:33 +0200 Subject: [PATCH] docs: typos in config page --- docs/config/index.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/config/index.md b/docs/config/index.md index 356e9b37831e32..1cbfdd713cc00d 100644 --- a/docs/config/index.md +++ 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. @@ -148,7 +148,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 +282,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 +632,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