{"id":13506846,"url":"https://github.com/element-plus/unplugin-element-plus","last_synced_at":"2025-05-15T05:06:05.569Z","repository":{"id":37981275,"uuid":"402409065","full_name":"element-plus/unplugin-element-plus","owner":"element-plus","description":"🔌 Import Element Plus on demand. Support Vite, Webpack, Vue CLI, Rollup and esbuild.","archived":false,"fork":false,"pushed_at":"2025-05-05T05:40:40.000Z","size":1421,"stargazers_count":233,"open_issues_count":8,"forks_count":34,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-05-06T18:05:38.988Z","etag":null,"topics":["element-plus","esbuild","rollup","unplugin","vite","vue","webpack"],"latest_commit_sha":null,"homepage":"https://unplugin.element-plus.org","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/element-plus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["sxzz","JeremyWuuuuu","YunYouJun","element-plus"]}},"created_at":"2021-09-02T12:17:44.000Z","updated_at":"2025-05-05T05:39:38.000Z","dependencies_parsed_at":"2023-02-09T03:30:18.916Z","dependency_job_id":"56b3be94-830d-4511-bd56-d34190d373d2","html_url":"https://github.com/element-plus/unplugin-element-plus","commit_stats":{"total_commits":239,"total_committers":11,"mean_commits":"21.727272727272727","dds":0.4435146443514645,"last_synced_commit":"90b50e007624fb4bb285811ac38d1597388b2189"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/element-plus%2Funplugin-element-plus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/element-plus%2Funplugin-element-plus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/element-plus%2Funplugin-element-plus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/element-plus%2Funplugin-element-plus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/element-plus","download_url":"https://codeload.github.com/element-plus/unplugin-element-plus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254276447,"owners_count":22043867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["element-plus","esbuild","rollup","unplugin","vite","vue","webpack"],"created_at":"2024-08-01T01:00:58.808Z","updated_at":"2025-05-15T05:06:05.497Z","avatar_url":"https://github.com/element-plus.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg width=\"300px\" src=\"https://user-images.githubusercontent.com/10731096/95823103-9ce15780-0d5f-11eb-8010-1bd1b5910d4f.png\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.org/package/unplugin-element-plus\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/unplugin-element-plus.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://npmcharts.com/compare/unplugin-element-plus?minimal=true\"\u003e\n    \u003cimg src=\"http://img.shields.io/npm/dm/unplugin-element-plus.svg\"\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e\n\u003c/p\u003e\n\n# unplugin-element-plus\n\n[![Unit Test](https://github.com/element-plus/unplugin-element-plus/actions/workflows/unit-test.yml/badge.svg)](https://github.com/element-plus/unplugin-element-plus/actions/workflows/unit-test.yml)\n\n[English](README.md) | [中文](README.zh-CN.md)\n\nThis repo is for element-plus related [unplugin](https://github.com/unjs/unplugin). Thanks [@antfu](https://github.com/antfu).\n\n###### Features\n\n- 💚 On-demand import style for Element Plus.\n- 🌎 Replace default locale.\n- ⚡️ Supports Vite, Webpack, Vue CLI, Rollup, esbuild and more, powered by \u003ca href=\"https://github.com/unjs/unplugin\"\u003eunplugin\u003c/a\u003e.\n\n## Installation\n\n```bash\nnpm i unplugin-element-plus -D\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eVite\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// vite.config.ts\nimport ElementPlus from 'unplugin-element-plus/vite'\n\nexport default {\n  plugins: [\n    ElementPlus({\n      // options\n    }),\n  ],\n}\n```\n\n\u003cbr\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eRollup\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// rollup.config.js\nimport ElementPlus from 'unplugin-element-plus/rollup'\n\nexport default {\n  plugins: [\n    ElementPlus({\n      // options\n    }),\n  ],\n}\n```\n\n\u003cbr\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eesbuild\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// esbuild.config.js\nimport { build } from 'esbuild'\n\nbuild({\n  plugins: [\n    require('unplugin-element-plus/esbuild')({\n      // options\n    }),\n  ],\n})\n```\n\n\u003cbr\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eWebpack\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// webpack.config.js\nmodule.exports = {\n  /* ... */\n  plugins: [\n    require('unplugin-element-plus/webpack')({\n      // options\n    }),\n  ],\n}\n```\n\n\u003cbr\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eVue CLI\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// vue.config.js\nmodule.exports = {\n  configureWebpack: {\n    plugins: [\n      require('unplugin-element-plus/webpack')({\n        // options\n      }),\n    ],\n  },\n}\n```\n\n\u003cbr\u003e\u003c/details\u003e\n\n## Usage\n\nIt will automatically transform:\n\n```javascript\nimport { ElButton } from 'element-plus'\n\n//    ↓ ↓ ↓ ↓ ↓ ↓\n\nimport { ElButton } from 'element-plus'\nimport 'element-plus/es/components/button/style/css'\n```\n\n## Options\n\n### `useSource`\n\n```ts\ntype UseSource = boolean\n```\n\ndefault: `false`\n\n```javascript\n// useSource: false\nimport { ElButton } from 'element-plus'\n\n//    ↓ ↓ ↓ ↓ ↓ ↓\n\nimport { ElButton } from 'element-plus'\nimport 'element-plus/es/components/button/style/css'\n\n// useSource: true\nimport { ElButton } from 'element-plus'\n\n//    ↓ ↓ ↓ ↓ ↓ ↓\n\nimport { ElButton } from 'element-plus'\nimport 'element-plus/es/components/button/style/index'\n```\n\n### `lib`\n\nNormally you wouldn't use this option but as a general option we exposed it anyway.\nWhen using this your bundle structure should be the same as ElementPlus.\nSee [unpkg.com](https://unpkg.com/element-plus) for more information.\n\n```ts\ntype Lib = string\n```\n\ndefault: 'element-plus'\n\n```javascript\n// lib: 'other-lib'\nimport { ElButton } from 'other-lib'\n\n//    ↓ ↓ ↓ ↓ ↓ ↓\n\nimport { ElButton } from 'other-lib'\nimport 'other-lib/es/components/button/style/css'\n```\n\n### `format`\n\n```ts\ntype Format = 'esm' | 'cjs'\n```\n\ndefault: 'esm'\n\n`esm` for `element-plus/es/components/*`\n\n`cjs` for `element-plus/lib/components/*`\n\n- `/es` for ES Module\n- `/lib` for CommonJS\n\nThis option is for which format to use\n\n```javascript\n// format: 'cjs'\nimport { ElButton } from 'element-plus'\n\n//    ↓ ↓ ↓ ↓ ↓ ↓\n\nimport { ElButton } from 'element-plus'\nimport 'element-plus/lib/components/button/style/css'\n```\n\n### `prefix`\n\n```ts\ntype Prefix = string\n```\n\n```javascript\n// prefix = Al\nimport { AlButton } from 'xx-lib'\n```\n\n### `ignoreComponents`\n\n```ts\ntype IgnoreComponents = string[]\n```\n\nSkip style imports for a list of components. Useful for Element Plus components which do not have a style file.\nAt the time of writing, this is only the `AutoResizer` component.\n\n```javascript\n// format: 'cjs'\nimport { ElAutoResizer } from 'element-plus'\n\n//    ↓ ↓ ↓ ↓ ↓ ↓\n\nimport { ElAutoResizer } from 'element-plus'\n```\n\n### `defaultLocale`\n\nReplace default locale, you can find locale list [here](https://github.com/element-plus/element-plus/tree/dev/packages/locale/lang).\n\n## Alternate\n\n- [unplugin-vue-components](https://github.com/antfu/unplugin-vue-components)\n","funding_links":["https://github.com/sponsors/sxzz","https://github.com/sponsors/JeremyWuuuuu","https://github.com/sponsors/YunYouJun","https://github.com/sponsors/element-plus"],"categories":["Official","TypeScript","Resources"],"sub_categories":["Official Resources","Official Project"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felement-plus%2Funplugin-element-plus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felement-plus%2Funplugin-element-plus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felement-plus%2Funplugin-element-plus/lists"}