Skip to content

API / wxt/modules / addViteConfig

Function: addViteConfig()

addViteConfig(wxt, viteConfig): void

Source: packages/wxt/src/modules.ts:109

Merge additional vite config for one or more entrypoint "groups" that make up individual builds. Config in the project's wxt.config.ts file takes precedence over any config added by this function.

Parameters

wxt

Wxt

The wxt instance provided by the module's setup function.

viteConfig

(env) => UserConfig | undefined

A function that returns the vite config the module is adding. Same format as vite in wxt.config.ts.

Returns

void

Example

ts
export default defineWxtModule((wxt, options) => {
  addViteConfig(wxt, () => ({
  build: {
  sourceMaps: true,
  },
  });
  });

Generated using typedoc-plugin-markdown and TypeDoc