# unplugin-vue-define-options

> Add defineOptions macro for Vue .

Latest version **3.1.4** (published 2026-07-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install unplugin-vue-define-options
pnpm add unplugin-vue-define-options
yarn add unplugin-vue-define-options
bun add unplugin-vue-define-options
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.1.4 |
| Published | 2026-07-19 |
| First published | 2022-02-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20.19.0 |
| Dependencies | 3 |
| Unpacked size | 12.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1987 |
| Author | Kevin Deng |
| Maintainers | sxzz |
| Keywords | vue-macros, macros, vue, sfc, setup, script-setup, define-options, unplugin |

## Links

- npm: https://www.npmjs.com/package/unplugin-vue-define-options
- Repository: https://github.com/vue-macros/vue-macros
- Homepage: https://vue-macros.dev
- Issues: https://github.com/vue-macros/vue-macros/issues
- Funding: https://github.com/sponsors/vue-macros
- npm.io page: https://npm.io/package/unplugin-vue-define-options

## Dependencies (3)

- [unplugin](https://npm.io/package/unplugin.md) ^2.3.10
- [ast-walker-scope](https://npm.io/package/ast-walker-scope.md) ^0.8.2
- [@vue-macros/common](https://npm.io/package/@vue-macros/common.md) 3.1.4

## Recent versions

- 3.1.4 (latest) — 2026-07-19
- 0.12.2-beta.1 (beta) — 2022-10-20
- 3.1.3 — 2026-07-12
- 3.1.2 — 2026-01-04
- 3.1.1 — 2025-09-25
- 3.1.0 — 2025-09-23
- 3.0.1 — 2025-09-23
- 3.0.0 — 2025-09-20
- 3.0.0-rc.0 — 2025-09-16
- 3.0.0-beta.23 — 2025-09-05
- 3.0.0-beta.22 — 2025-08-30
- 3.0.0-beta.21 — 2025-08-06
- 3.0.0-beta.20 — 2025-08-01
- 3.0.0-beta.19 — 2025-07-29
- 3.0.0-beta.18 — 2025-07-29
- … 120 more at https://npm.io/package/unplugin-vue-define-options/versions

## README

<p align="center">
  <img src="https://github.com/vue-macros/vue-macros/raw/main/docs/public/logo.svg" width="200px" />
</p>

# unplugin-vue-define-options [![npm](https://img.shields.io/npm/v/unplugin-vue-define-options.svg)](https://npmjs.com/package/unplugin-vue-define-options)

Options API can be declared using the `defineOptions` in `<script setup>`, specifically to be able to set `name`, `props`, `emits`, and `render` inside of one function.

If you support this feature, feel free to hit like 👍 or comment on [RFC Discussion](https://github.com/vuejs/rfcs/discussions/430). Thanks!

## Features

- ✨ With this macro, you can use Options API in Vue `<script setup>`.
- 💚 Supports both Vue 2.7 and Vue 3 out-of-the-box.
- 🦾 Full TypeScript support.
- ⚡️ Supports most bundlers powered by [unplugin](https://github.com/unjs/unplugin).
  - Vite, Nuxt
  - Webpack, Rspack, Vue CLI
  - Rollup
  - esbuild
  - and more...

## Usage

[📜 Documentation](https://vue-macros.dev/macros/define-options.html)

### See Also

- [Related issue](https://github.com/vuejs/core/issues/5218#issuecomment-1032107354)
- [RFC](https://github.com/vuejs/rfcs/discussions/430)

## Sponsors

<p align="center">
  <a href="https://cdn.jsdelivr.net/gh/sxzz/sponsors/sponsors.wide.svg">
    <img src='https://cdn.jsdelivr.net/gh/sxzz/sponsors/sponsors.wide.svg'/>
  </a>
</p>

## License

[MIT](./LICENSE) License © 2022-PRESENT [Kevin Deng](https://github.com/sxzz)

---
_Source: https://npm.io/package/unplugin-vue-define-options · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
