---
url: /api/reference/modules/functions/addImportPreset.md
---

[API](../../packages.md) / [modules](../index.md) / addImportPreset

# Function: addImportPreset()

> **addImportPreset**(`wxt`, `preset`): `void`

Source: [packages/wxt/src/modules/index.ts:187](https://github.com/wxt-dev/wxt/blob/972fe87151a882800f7855a3951c70cef4441659/packages/wxt/src/modules/index.ts#L187)

Add an Unimport preset
([built-in](https://github.com/unjs/unimport?tab=readme-ov-file#built-in-presets),
[custom](https://github.com/unjs/unimport?tab=readme-ov-file#custom-presets),
or
[auto-scanned](https://github.com/unjs/unimport?tab=readme-ov-file#exports-auto-scan)),
to the project's list of auto-imported utilities.

Some things to note:

* This function will only de-duplicate built-in preset names. It will not stop
  you adding duplicate custom or auto-scanned presets.
* If the project has disabled imports, this function has no effect.

## Parameters

### wxt

[`Wxt`](../../wxt/interfaces/Wxt.md)

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

### preset

`Preset` | `"@vue/composition-api"` | `"@vueuse/core"` | `"@vueuse/head"` | `"pinia"` | `"preact"` | `"quasar"` | `"react"` | `"react-router"` | `"react-router-dom"` | `"svelte"` | `"svelte/animate"` | `"svelte/easing"` | `"svelte/motion"` | `"svelte/store"` | `"svelte/transition"` | `"vee-validate"` | `"vitepress"` | `"vue-demi"` | `"vue-i18n"` | `"vue-router"` | `"vue-router-composables"` | `"vue"` | `"vue/macros"` | `"vuex"` | `"vitest"` | `"uni-app"` | `"solid-js"` | `"solid-app-router"` | `"rxjs"` | `"date-fns"`

The preset to add to the project.

## Returns

`void`

## Example

```ts
export default defineWxtModule((wxt) => {
  // Built-in preset:
  addImportPreset(wxt, "vue");
  // Custom preset:
  addImportPreset(wxt, {
  from: "vue",
  imports: ["ref", "reactive", ...],
  });
  // Auto-scanned preset:
  addImportPreset(wxt, { package: "vue" });
  });
```

***

Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/)
