From ca471d59e87498ac7992e98d7a1ca093cced225e Mon Sep 17 00:00:00 2001 From: patak Date: Sat, 3 Jul 2021 00:17:41 +0200 Subject: [PATCH] docs: config hook is async (#4075) --- guide/api-plugin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guide/api-plugin.md b/guide/api-plugin.md index 879e3a2..d918a19 100644 --- a/guide/api-plugin.md +++ b/guide/api-plugin.md @@ -150,7 +150,7 @@ Vite plugins can also provide hooks that serve Vite-specific purposes. These hoo ### `config` - **Type:** `(config: UserConfig, env: { mode: string, command: string }) => UserConfig | null | void` -- **Kind:** `sync`, `sequential` +- **Kind:** `async`, `sequential` Modify Vite config before it's resolved. The hook receives the raw user config (CLI options merged with config file) and the current config env which exposes the `mode` and `command` being used. It can return a partial config object that will be deeply merged into existing config, or directly mutate the config (if the default merging cannot achieve the desired result).