From c366ae3b61970ec47af082c6df9e883a3db4d284 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Mon, 3 Feb 2025 16:30:06 +0200 Subject: [PATCH] chore(framework): add example of admin's vite configurations (#11283) --- packages/core/framework/src/config/types.ts | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/packages/core/framework/src/config/types.ts b/packages/core/framework/src/config/types.ts index 0b8d145ee7..be40e443d7 100644 --- a/packages/core/framework/src/config/types.ts +++ b/packages/core/framework/src/config/types.ts @@ -89,8 +89,26 @@ export type AdminOptions = { /** * Configure the Vite configuration for the admin dashboard. This function receives the default Vite configuration * and returns the modified configuration. The default value is `undefined`. + * + * Learn about configurations you can pass to Vite in [Vite's documentation](https://vite.dev/config/). * - * @privateRemarks TODO Add example + * @example + * For example, if you're using a third-party library that isn't ESM-compatible, add it to Vite's `optimizeDeps` configuration: + * + * ```ts title="medusa-config.ts" + * module.exports = defineConfig({ + * admin: { + * vite: () => { + * return { + * optimizeDeps: { + * include: ["qs"], + * }, + * }; + * }, + * }, + * // ... + * }) + * ``` */ vite?: (config: InlineConfig) => InlineConfig }