From 5c177db9597344b8151c8e421ddbced36c4151c7 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) --- docs/guide/api-plugin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/api-plugin.md b/docs/guide/api-plugin.md index 879e3a2aa0e4f9..d918a19ac66f6b 100644 --- a/docs/guide/api-plugin.md +++ b/docs/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).