unplugin-vue-components 30.0.0 → 31.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -37
- package/dist/esbuild.d.mts +6 -0
- package/dist/esbuild.mjs +6 -0
- package/dist/index.d.mts +12 -0
- package/dist/index.mjs +3 -0
- package/dist/nuxt.d.mts +7 -0
- package/dist/{nuxt.js → nuxt.mjs} +4 -7
- package/dist/{resolvers.d.ts → resolvers.d.mts} +9 -31
- package/dist/{resolvers.js → resolvers.mjs} +99 -162
- package/dist/rolldown.d.mts +6 -0
- package/dist/rolldown.mjs +6 -0
- package/dist/rollup.d.mts +6 -0
- package/dist/rollup.mjs +6 -0
- package/dist/rspack.d.mts +6 -0
- package/dist/rspack.mjs +6 -0
- package/dist/{src-BcnnO6GN.js → src-M1OY6Uso.mjs} +51 -150
- package/dist/{types-DSJ5r-ta.d.cts → types-BbnOeCab.d.mts} +11 -19
- package/dist/types.d.mts +2 -0
- package/dist/types.mjs +1 -0
- package/dist/utils-BfjsfvcK.mjs +229 -0
- package/dist/vite.d.mts +9 -0
- package/dist/vite.mjs +6 -0
- package/dist/webpack.d.mts +6 -0
- package/dist/webpack.mjs +6 -0
- package/package.json +45 -78
- package/dist/esbuild.cjs +0 -9
- package/dist/esbuild.d.cts +0 -6
- package/dist/esbuild.d.ts +0 -7
- package/dist/esbuild.js +0 -9
- package/dist/index.cjs +0 -9
- package/dist/index.d.cts +0 -13
- package/dist/index.d.ts +0 -13
- package/dist/index.js +0 -5
- package/dist/nuxt.cjs +0 -14
- package/dist/nuxt.d.cts +0 -6
- package/dist/nuxt.d.ts +0 -7
- package/dist/resolvers.cjs +0 -2074
- package/dist/resolvers.d.cts +0 -574
- package/dist/rolldown.cjs +0 -9
- package/dist/rolldown.d.cts +0 -6
- package/dist/rolldown.d.ts +0 -7
- package/dist/rolldown.js +0 -9
- package/dist/rollup.cjs +0 -9
- package/dist/rollup.d.cts +0 -6
- package/dist/rollup.d.ts +0 -7
- package/dist/rollup.js +0 -9
- package/dist/rspack.cjs +0 -9
- package/dist/rspack.d.cts +0 -5
- package/dist/rspack.d.ts +0 -6
- package/dist/rspack.js +0 -9
- package/dist/src-BTwFq3T3.cjs +0 -188
- package/dist/src-D2-JfLYq.js +0 -187
- package/dist/src-DzdkjKhH.cjs +0 -769
- package/dist/types-CBTc19th.cjs +0 -0
- package/dist/types-DQoXDiso.js +0 -1
- package/dist/types-rC3290ja.d.ts +0 -225
- package/dist/types.cjs +0 -1
- package/dist/types.d.cts +0 -2
- package/dist/types.d.ts +0 -2
- package/dist/types.js +0 -3
- package/dist/utils-8UQ22cuO.cjs +0 -1689
- package/dist/utils-BoXu-4gQ.js +0 -1523
- package/dist/vite.cjs +0 -9
- package/dist/vite.d.cts +0 -8
- package/dist/vite.d.ts +0 -9
- package/dist/vite.js +0 -9
- package/dist/webpack.cjs +0 -9
- package/dist/webpack.d.cts +0 -6
- package/dist/webpack.d.ts +0 -7
- package/dist/webpack.js +0 -9
package/README.md
CHANGED
|
@@ -6,9 +6,9 @@ On-demand components auto importing for Vue.
|
|
|
6
6
|
|
|
7
7
|
###### Features
|
|
8
8
|
|
|
9
|
-
- 💚 Supports
|
|
9
|
+
- 💚 Supports Vue 3 out-of-the-box.
|
|
10
10
|
- ✨ Supports both components and directives.
|
|
11
|
-
- ⚡️ Supports Vite, Webpack, Rspack,
|
|
11
|
+
- ⚡️ Supports Vite, Webpack, Rspack, Rollup, Rolldown, esbuild and more, powered by <a href="https://github.com/unjs/unplugin">unplugin</a>.
|
|
12
12
|
- 🏝 Tree-shakable, only registers the components you use.
|
|
13
13
|
- 🪐 Folder names as namespaces.
|
|
14
14
|
- 🦾 Full TypeScript support.
|
|
@@ -19,7 +19,7 @@ On-demand components auto importing for Vue.
|
|
|
19
19
|
|
|
20
20
|
<p align="center">
|
|
21
21
|
<a href="https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg">
|
|
22
|
-
<img src='https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg'/>
|
|
22
|
+
<img src='https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg' alt='Sponsors'/>
|
|
23
23
|
</a>
|
|
24
24
|
</p>
|
|
25
25
|
|
|
@@ -86,6 +86,7 @@ export default {
|
|
|
86
86
|
|
|
87
87
|
```ts
|
|
88
88
|
// webpack.config.js
|
|
89
|
+
// unplugin-vue-components removed support for CommonJS after version 29.1.0
|
|
89
90
|
module.exports = {
|
|
90
91
|
/* ... */
|
|
91
92
|
plugins: [
|
|
@@ -101,6 +102,7 @@ module.exports = {
|
|
|
101
102
|
|
|
102
103
|
```ts
|
|
103
104
|
// rspack.config.js
|
|
105
|
+
// unplugin-vue-components removed support for CommonJS after version 29.1.0
|
|
104
106
|
module.exports = {
|
|
105
107
|
/* ... */
|
|
106
108
|
plugins: [
|
|
@@ -118,36 +120,6 @@ You might not need this plugin for Nuxt. Use [`@nuxt/components`](https://github
|
|
|
118
120
|
|
|
119
121
|
<br></details>
|
|
120
122
|
|
|
121
|
-
<details>
|
|
122
|
-
<summary>Vue CLI</summary><br>
|
|
123
|
-
|
|
124
|
-
```ts
|
|
125
|
-
// vue.config.js
|
|
126
|
-
module.exports = {
|
|
127
|
-
/* ... */
|
|
128
|
-
plugins: [
|
|
129
|
-
require('unplugin-vue-components/webpack')({ /* options */ }),
|
|
130
|
-
],
|
|
131
|
-
}
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
You can also rename the Vue configuration file to `vue.config.mjs` and use static import syntax (you should use latest `@vue/cli-service ^5.0.8`):
|
|
135
|
-
|
|
136
|
-
```ts
|
|
137
|
-
// vue.config.mjs
|
|
138
|
-
import Components from 'unplugin-vue-components/webpack'
|
|
139
|
-
|
|
140
|
-
export default {
|
|
141
|
-
configureWebpack: {
|
|
142
|
-
plugins: [
|
|
143
|
-
Components({ /* options */ }),
|
|
144
|
-
],
|
|
145
|
-
},
|
|
146
|
-
}
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
<br></details>
|
|
150
|
-
|
|
151
123
|
<details>
|
|
152
124
|
<summary>Quasar</summary><br>
|
|
153
125
|
|
|
@@ -266,7 +238,6 @@ Supported Resolvers:
|
|
|
266
238
|
- [Arco Design Vue](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/arco.ts)
|
|
267
239
|
- [BootstrapVue](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/bootstrap-vue.ts)
|
|
268
240
|
- [Element Plus](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/element-plus.ts)
|
|
269
|
-
- [Element UI](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/element-ui.ts)
|
|
270
241
|
- [Headless UI](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/headless-ui.ts)
|
|
271
242
|
- [IDux](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/idux.ts)
|
|
272
243
|
- [Inkline](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/inkline.ts)
|
|
@@ -440,9 +411,6 @@ Components({
|
|
|
440
411
|
globalNamespaces: [],
|
|
441
412
|
|
|
442
413
|
// auto import for directives
|
|
443
|
-
// default: `true` for Vue 3, `false` for Vue 2
|
|
444
|
-
// Babel is needed to do the transformation for Vue 2, it's disabled by default for performance concerns.
|
|
445
|
-
// To install Babel, run: `npm install -D @babel/parser`
|
|
446
414
|
directives: true,
|
|
447
415
|
|
|
448
416
|
// Transform path before resolving
|
package/dist/esbuild.mjs
ADDED
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { a as ComponentResolverObject, c as ImportInfoLegacy, d as PublicPluginAPI, f as ResolvedOptions, h as TypeImport, i as ComponentResolverFunction, l as Matcher, m as Transformer, n as ComponentResolveResult, o as ComponentsImportMap, p as SideEffectsInfo, r as ComponentResolver, s as ImportInfo, t as ComponentInfo, u as Options } from "./types-BbnOeCab.mjs";
|
|
2
|
+
import * as unplugin from "unplugin";
|
|
3
|
+
import { FilterPattern } from "unplugin-utils";
|
|
4
|
+
//#region src/core/unplugin.d.ts
|
|
5
|
+
declare const _default: unplugin.UnpluginInstance<Options, boolean>;
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/core/utils.d.ts
|
|
8
|
+
declare function pascalCase(str: string): string;
|
|
9
|
+
declare function camelCase(str: string): string;
|
|
10
|
+
declare function kebabCase(key: string): string;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { ComponentInfo, ComponentResolveResult, ComponentResolver, ComponentResolverFunction, ComponentResolverObject, ComponentsImportMap, ImportInfo, ImportInfoLegacy, Matcher, Options, PublicPluginAPI, ResolvedOptions, SideEffectsInfo, Transformer, TypeImport, camelCase, _default as default, kebabCase, pascalCase };
|
package/dist/index.mjs
ADDED
package/dist/nuxt.d.mts
ADDED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import "./utils-
|
|
2
|
-
import { unplugin_default } from "./src-
|
|
3
|
-
import "./types-DQoXDiso.js";
|
|
1
|
+
import "./utils-BfjsfvcK.mjs";
|
|
2
|
+
import { t as unplugin_default } from "./src-M1OY6Uso.mjs";
|
|
4
3
|
import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from "@nuxt/kit";
|
|
5
|
-
|
|
6
4
|
//#region src/nuxt.ts
|
|
7
|
-
|
|
5
|
+
const module = defineNuxtModule({ setup(options) {
|
|
8
6
|
addWebpackPlugin(unplugin_default.webpack(options));
|
|
9
7
|
addVitePlugin(unplugin_default.vite(options));
|
|
10
8
|
} });
|
|
11
|
-
|
|
12
9
|
//#endregion
|
|
13
|
-
export {
|
|
10
|
+
export { module as default };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ComponentResolveResult, ComponentResolver } from "./types-
|
|
1
|
+
import { n as ComponentResolveResult, r as ComponentResolver } from "./types-BbnOeCab.mjs";
|
|
2
2
|
import { FilterPattern } from "unplugin-utils";
|
|
3
3
|
|
|
4
4
|
//#region src/core/resolvers/antdv.d.ts
|
|
5
|
+
type AntDesignVueResolveDateLibrary = 'dayjs' | 'date-fns' | 'moment';
|
|
5
6
|
interface AntDesignVueResolverOptions {
|
|
6
7
|
/**
|
|
7
8
|
* exclude components that do not require automatic import
|
|
@@ -46,6 +47,12 @@ interface AntDesignVueResolverOptions {
|
|
|
46
47
|
* @default 'A'
|
|
47
48
|
*/
|
|
48
49
|
prefix?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Custom date library.
|
|
52
|
+
*
|
|
53
|
+
* @default 'dayjs'
|
|
54
|
+
*/
|
|
55
|
+
resolveDateLibrary?: AntDesignVueResolveDateLibrary;
|
|
49
56
|
}
|
|
50
57
|
/**
|
|
51
58
|
* Resolver for Ant Design Vue
|
|
@@ -206,27 +213,6 @@ interface ElementPlusResolverOptions {
|
|
|
206
213
|
*/
|
|
207
214
|
declare function ElementPlusResolver(options?: ElementPlusResolverOptions): ComponentResolver[];
|
|
208
215
|
//#endregion
|
|
209
|
-
//#region src/core/resolvers/element-ui.d.ts
|
|
210
|
-
interface ElementUiResolverOptions {
|
|
211
|
-
/**
|
|
212
|
-
* import style css or sass with components
|
|
213
|
-
*
|
|
214
|
-
* @default 'css'
|
|
215
|
-
*/
|
|
216
|
-
importStyle?: boolean | 'css' | 'sass';
|
|
217
|
-
/**
|
|
218
|
-
* exclude component name, if match do not resolve the name
|
|
219
|
-
*/
|
|
220
|
-
exclude?: RegExp;
|
|
221
|
-
}
|
|
222
|
-
/**
|
|
223
|
-
* Resolver for Element-UI
|
|
224
|
-
* @link https://element.eleme.cn/#/zh-CN
|
|
225
|
-
* @version @element-ui ^2.15.3, @vue ^2.6.14
|
|
226
|
-
* @author @nabaonan
|
|
227
|
-
*/
|
|
228
|
-
declare function ElementUiResolver(options?: ElementUiResolverOptions): ComponentResolver;
|
|
229
|
-
//#endregion
|
|
230
216
|
//#region src/core/resolvers/headless-ui.d.ts
|
|
231
217
|
interface HeadlessUiResolverOptions {
|
|
232
218
|
/**
|
|
@@ -429,13 +415,6 @@ declare function VantResolver(options?: VantResolverOptions): ComponentResolver;
|
|
|
429
415
|
//#endregion
|
|
430
416
|
//#region src/core/resolvers/varlet-ui.d.ts
|
|
431
417
|
interface VarletUIResolverOptions {
|
|
432
|
-
/**
|
|
433
|
-
* support vue version
|
|
434
|
-
* vue3 use @varlet/ui, vue2 use @varlet-vue2/ui
|
|
435
|
-
*
|
|
436
|
-
* @default 'vue3'
|
|
437
|
-
*/
|
|
438
|
-
version?: 'vue3' | 'vue2';
|
|
439
418
|
/**
|
|
440
419
|
* import style along with components
|
|
441
420
|
*
|
|
@@ -474,7 +453,6 @@ declare function getResolved(name: string, options: VarletUIResolverOptions): Co
|
|
|
474
453
|
* Resolver for VarletUI
|
|
475
454
|
*
|
|
476
455
|
* @link https://github.com/varletjs/varlet
|
|
477
|
-
* @link https://github.com/varletjs/varlet-vue2
|
|
478
456
|
*/
|
|
479
457
|
declare function VarletUIResolver(options?: VarletUIResolverOptions): ComponentResolver[];
|
|
480
458
|
//#endregion
|
|
@@ -571,4 +549,4 @@ declare function VueUseComponentsResolver(): ComponentResolver;
|
|
|
571
549
|
*/
|
|
572
550
|
declare function VueUseDirectiveResolver(): ComponentResolver;
|
|
573
551
|
//#endregion
|
|
574
|
-
export { AllowResolveIconOption, AntDesignVueResolver, AntDesignVueResolverOptions, ArcoResolver, ArcoResolverOptions, BootstrapVue3Resolver, BootstrapVueNextResolver, BootstrapVueResolver, BootstrapVueResolverOptions, DevResolverOptions, DevUiResolver, DisallowResolveIconOption, ElementPlusResolver, ElementPlusResolverOptions,
|
|
552
|
+
export { AllowResolveIconOption, AntDesignVueResolveDateLibrary, AntDesignVueResolver, AntDesignVueResolverOptions, ArcoResolver, ArcoResolverOptions, BootstrapVue3Resolver, BootstrapVueNextResolver, BootstrapVueResolver, BootstrapVueResolverOptions, DevResolverOptions, DevUiResolver, DisallowResolveIconOption, ElementPlusResolver, ElementPlusResolverOptions, HeadlessUiResolver, HeadlessUiResolverOptions, IduxResolver, IduxResolverOptions, InklineResolver, IonicBuiltInComponents, IonicResolver, LayuiVueResolver, LayuiVueResolverOptions, NaiveUiResolver, PrimeVueResolver, PrimeVueResolverOptions, QuasarResolver, ResolveIconsOption, TDesignResolver, TDesignResolverOptions, VantResolver, VantResolverOptions, VarletUIResolver, VarletUIResolverOptions, VeuiResolver, VeuiResolverOptions, ViewUiResolver, VueUseComponentsResolver, VueUseDirectiveResolver, Vuetify3Resolver, VuetifyResolver, getResolved };
|