An unplugin-based tool for on-demand Element Plus style imports and locale replacement. Current stable version is 0.11.2. Release cadence is irregular with breaking changes in major versions. Key differentiators: supports Vite, Webpack, Vue CLI, Rollup, esbuild, Rspack, and Rolldown via unplugin. Automatically injects the corresponding CSS/SCSS import for each Element Plus component used. Offers options like `useSource` for SCSS vs CSS, `format` for ESM/CJS, `prefix` for custom component prefixes, and `ignoreComponents` to skip certain components. Ships TypeScript types (v0.11.2).
npm install unplugin-element-plusVerified import paths — ran on the pinned version, not inferred.
Shows how to configure vite with ElementPlus plugin and demonstrates automatic style injection for ElButton and ElInput.
Upgrade Node.js to 20.19 or newer.
Use ESM imports (import, import()) or configure bundler to handle ESM. For require() in Node.js, use dynamic import: const { default: ElementPlus } = await import('unplugin-element-plus/vite')Upgrade Node to 18+ (or 20.19+ for v0.11+), upgrade Webpack to 5+ and Vue CLI to 5+.
Use Element Plus's built-in locale system or use `unplugin-vue-components` for locale handling.
Set the `lib` option to match the third-party library's name and ensure its package structure mirrors element-plus.
Use dynamic import: const { default: ElementPlus } = await import('unplugin-element-plus/vite') or switch to ESM config.Add .default: const ElementPlus = require('unplugin-element-plus/webpack').defaultUpgrade Node.js to 20.19 or later, or downgrade to unplugin-element-plus@0.10.x.