unplugin-vue-components is an unplugin-powered build tool plugin that provides on-demand auto-importing for Vue 3 components and directives. It eliminates the need for manual `import` statements and component registrations, simplifying development workflows and enabling automatic code-splitting for asynchronously loaded parent components. The current stable version is 32.0.0, released in April 2026. The project maintains a frequent release cadence, with minor and patch versions released regularly (often weekly or bi-weekly) and major versions introducing breaking changes every few months. Its key differentiators include broad build tool support (Vite, Webpack, Rollup, Rolldown, esbuild, Rspack) via the `unplugin` ecosystem, tree-shakability, built-in resolvers for popular UI libraries, folder-based namespaces, and full TypeScript support, including generated type declarations. It also integrates well with `unplugin-icons` for icon auto-importing.
npm install unplugin-vue-componentsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates configuring `unplugin-vue-components` with Vite and Vue 3, including how to set up component scanning, use UI library resolvers (like Element Plus), and enable TypeScript declaration generation. It also shows common configuration options for directories, inclusions, and exclusions.
Review the `unplugin` v3 changelog and update any custom `unplugin` configurations or integrations accordingly.
Convert build configuration files (e.g., `webpack.config.js`, `rollup.config.js`) to use ESM syntax (`import`/`export`). For Webpack, consider renaming `.js` to `.mjs` or using dynamic `import()` for the plugin. Ensure your Node.js environment is configured for ESM.
Upgrade your Node.js environment to version 20.19.0 or newer.
For Vue 2 projects, stick to a version prior to 31.0.0. For Vue 3 projects migrating from `element-ui`, switch to `element-plus` and its corresponding resolver (`ElementPlusResolver`).
Ensure your Nuxt project is updated to a version compatible with `@nuxt/kit` v4, or use a version of `unplugin-vue-components` prior to v29.0.0.
For Nuxt projects, consider using `@nuxt/components`. If `unplugin-vue-components` is still desired for specific advanced features, ensure it's configured carefully alongside Nuxt's built-in capabilities to avoid conflicts.
Update your build configuration file (e.g., `webpack.config.js`, `rollup.config.js`) to use ESM `import` statements or dynamic `import()`. For Webpack, consider renaming your config file to `webpack.config.mjs`.
Ensure the `Components` plugin is called with an object `Components({ /* options */ })` and that `dts: true` is set if you rely on type generation. Double-check all resolver configurations and component directories for correctness.Upgrade your Node.js environment to version 20.19.0 or newer. Use a Node.js version manager like `nvm` to switch versions if needed.