VuePressâs configuration can also be a function, while its first parameter is the current app context:
import { defineConfig } from "vuepress/config";
export default defineConfig(ctx => ({
// do not execute babel compilation under development
evergreen: ctx.isProd
}));
Limitations
It is worth noting that third-party plugins do not support Plugin Shorthand if youâre using Tuple Style to write your config, this is because from the perspective of the type system, the unknown shortcut is equivalent to string, which results in the failure of type inference.
By default, only officially maintained and plugins under VuePress Community support shortcut, feel free to submit pull request to add your plugin at this file.
Credits
bundle-require (by @egoist): we leverage it under the hood to resolve user's config, which is powered by esbuild.
vscode-ts-in-markdown (by @Amour1688): this documentation is powered by this plugin, which makes type checking possible in markdown.