weapp-vite 6.8.0 → 6.9.1
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/dist/auto-import-components/resolvers.d.mts +2 -0
- package/dist/auto-import-components/resolvers.mjs +309 -350
- package/dist/auto-routes.d.mts +17 -0
- package/dist/auto-routes.mjs +48 -78
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +1211 -2450
- package/dist/config-CZVIK2bS.d.mts +1396 -0
- package/dist/config.d.mts +2 -0
- package/dist/config.mjs +8 -31
- package/dist/createContext-BXXqwq78.mjs +19 -0
- package/dist/file-DDOGj0wV.mjs +258 -0
- package/dist/getInstance-CQOUmSp7.mjs +16170 -0
- package/dist/index-B5wBsuYI.d.mts +56 -0
- package/dist/index.d.mts +13 -0
- package/dist/index.mjs +9 -51
- package/dist/json.d.mts +2 -0
- package/dist/json.mjs +32 -14
- package/dist/logger-gutcwWKE.mjs +2 -0
- package/dist/mcp.d.mts +17 -0
- package/dist/mcp.mjs +39 -18
- package/dist/pluginHost-SJdl15d3.mjs +24 -0
- package/dist/rolldown-runtime-twds-ZHy.mjs +14 -0
- package/dist/routes-o20IHwXa.d.mts +13 -0
- package/dist/{runtime.d.ts → runtime.d.mts} +12 -11
- package/dist/runtime.mjs +32 -11
- package/dist/types.d.mts +4 -0
- package/dist/types.mjs +1 -37
- package/dist/volar.d.mts +2 -0
- package/dist/volar.mjs +3 -9
- package/package.json +38 -43
- package/dist/auto-import-components/resolvers.d.ts +0 -10
- package/dist/auto-routes.d.ts +0 -16
- package/dist/chunk-3BOPS2AF.mjs +0 -34
- package/dist/chunk-6N2JYDJN.mjs +0 -13
- package/dist/chunk-BKU4KQJE.mjs +0 -430
- package/dist/chunk-EZOXN44U.mjs +0 -48
- package/dist/chunk-FXWNWYDN.mjs +0 -6
- package/dist/chunk-GJOF3MJY.mjs +0 -39428
- package/dist/chunk-JFV2DERD.mjs +0 -30
- package/dist/chunk-LDBSARE6.mjs +0 -9911
- package/dist/chunk-MIQZQK74.mjs +0 -14
- package/dist/chunk-OU5WM7WT.mjs +0 -41
- package/dist/chunk-X4YQFGKK.mjs +0 -29
- package/dist/cli.d.ts +0 -2
- package/dist/config-D8v221vL.d.ts +0 -1051
- package/dist/config.d.ts +0 -18
- package/dist/file-W4JJII65.mjs +0 -29
- package/dist/getInstance-W65F2IS7.mjs +0 -18
- package/dist/index.d.ts +0 -29
- package/dist/json.d.ts +0 -18
- package/dist/mcp.d.ts +0 -47
- package/dist/routes-74eLuiqj.d.ts +0 -12
- package/dist/types-B6irZnLM.d.ts +0 -46
- package/dist/types.d.ts +0 -29
- package/dist/volar.d.ts +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as ExternalMetadataFileCandidates, c as Resolver, d as ResolverObject, i as CreateResolver, l as ResolverFn, n as VantResolver, o as Options, r as TDesignResolver, s as ResolvedValue, t as WeuiResolver, u as ResolverMeta } from "../index-B5wBsuYI.mjs";
|
|
2
|
+
export { CreateResolver, ExternalMetadataFileCandidates, Options, ResolvedValue, Resolver, ResolverFn, ResolverMeta, ResolverObject, TDesignResolver, VantResolver, WeuiResolver };
|
|
@@ -1,360 +1,319 @@
|
|
|
1
|
-
import {
|
|
2
|
-
init_esm_shims
|
|
3
|
-
} from "../chunk-EZOXN44U.mjs";
|
|
4
|
-
|
|
5
|
-
// src/auto-import-components/resolvers/index.ts
|
|
6
|
-
init_esm_shims();
|
|
7
|
-
|
|
8
|
-
// src/auto-import-components/resolvers/tdesign.ts
|
|
9
|
-
init_esm_shims();
|
|
10
1
|
import { defu } from "@weapp-core/shared";
|
|
11
|
-
|
|
12
|
-
// src/auto-import-components/resolvers/json/tdesign.json
|
|
2
|
+
//#region src/auto-import-components/resolvers/json/tdesign.json
|
|
13
3
|
var tdesign_default = [
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
4
|
+
"action-sheet",
|
|
5
|
+
"avatar",
|
|
6
|
+
"avatar-group",
|
|
7
|
+
"back-top",
|
|
8
|
+
"badge",
|
|
9
|
+
"button",
|
|
10
|
+
"calendar",
|
|
11
|
+
"cascader",
|
|
12
|
+
"cell",
|
|
13
|
+
"cell-group",
|
|
14
|
+
"check-tag",
|
|
15
|
+
"checkbox",
|
|
16
|
+
"checkbox-group",
|
|
17
|
+
"col",
|
|
18
|
+
"collapse",
|
|
19
|
+
"collapse-panel",
|
|
20
|
+
"color-picker",
|
|
21
|
+
"count-down",
|
|
22
|
+
"date-time-picker",
|
|
23
|
+
"dialog",
|
|
24
|
+
"divider",
|
|
25
|
+
"drawer",
|
|
26
|
+
"dropdown-item",
|
|
27
|
+
"dropdown-menu",
|
|
28
|
+
"empty",
|
|
29
|
+
"fab",
|
|
30
|
+
"footer",
|
|
31
|
+
"form",
|
|
32
|
+
"form-item",
|
|
33
|
+
"grid",
|
|
34
|
+
"grid-item",
|
|
35
|
+
"guide",
|
|
36
|
+
"icon",
|
|
37
|
+
"image",
|
|
38
|
+
"image-viewer",
|
|
39
|
+
"indexes",
|
|
40
|
+
"indexes-anchor",
|
|
41
|
+
"input",
|
|
42
|
+
"link",
|
|
43
|
+
"loading",
|
|
44
|
+
"message",
|
|
45
|
+
"message-item",
|
|
46
|
+
"navbar",
|
|
47
|
+
"notice-bar",
|
|
48
|
+
"overlay",
|
|
49
|
+
"picker",
|
|
50
|
+
"picker-item",
|
|
51
|
+
"popover",
|
|
52
|
+
"popup",
|
|
53
|
+
"progress",
|
|
54
|
+
"pull-down-refresh",
|
|
55
|
+
"qrcode",
|
|
56
|
+
"radio",
|
|
57
|
+
"radio-group",
|
|
58
|
+
"rate",
|
|
59
|
+
"result",
|
|
60
|
+
"row",
|
|
61
|
+
"scroll-view",
|
|
62
|
+
"search",
|
|
63
|
+
"side-bar",
|
|
64
|
+
"side-bar-item",
|
|
65
|
+
"skeleton",
|
|
66
|
+
"slider",
|
|
67
|
+
"step-item",
|
|
68
|
+
"stepper",
|
|
69
|
+
"steps",
|
|
70
|
+
"sticky",
|
|
71
|
+
"swipe-cell",
|
|
72
|
+
"swiper",
|
|
73
|
+
"swiper-nav",
|
|
74
|
+
"switch",
|
|
75
|
+
"tab-bar",
|
|
76
|
+
"tab-bar-item",
|
|
77
|
+
"tab-panel",
|
|
78
|
+
"tabs",
|
|
79
|
+
"tag",
|
|
80
|
+
"textarea",
|
|
81
|
+
"toast",
|
|
82
|
+
"transition",
|
|
83
|
+
"tree-select",
|
|
84
|
+
"upload",
|
|
85
|
+
"watermark"
|
|
96
86
|
];
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
`${baseDir}/index.js`
|
|
154
|
-
]
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
return resolver;
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region src/auto-import-components/resolvers/tdesign.ts
|
|
89
|
+
const defaultPrefix$2 = "t-";
|
|
90
|
+
const TDesignResolver = (opts) => {
|
|
91
|
+
const { prefix, resolve } = defu(opts, {
|
|
92
|
+
prefix: defaultPrefix$2,
|
|
93
|
+
resolve({ name, prefix }) {
|
|
94
|
+
return {
|
|
95
|
+
key: `${prefix}${name}`,
|
|
96
|
+
value: `tdesign-miniprogram/${name}/${name}`
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
const map = tdesign_default.reduce((acc, cur) => {
|
|
101
|
+
const { key, value } = resolve({
|
|
102
|
+
name: cur,
|
|
103
|
+
prefix
|
|
104
|
+
});
|
|
105
|
+
acc[key] = value;
|
|
106
|
+
return acc;
|
|
107
|
+
}, {});
|
|
108
|
+
return {
|
|
109
|
+
components: Object.freeze({ ...map }),
|
|
110
|
+
resolve(componentName) {
|
|
111
|
+
const from = map[componentName];
|
|
112
|
+
if (!from) return;
|
|
113
|
+
return {
|
|
114
|
+
name: componentName,
|
|
115
|
+
from
|
|
116
|
+
};
|
|
117
|
+
},
|
|
118
|
+
resolveExternalMetadataCandidates(from) {
|
|
119
|
+
if (!from.startsWith("tdesign-miniprogram/")) return;
|
|
120
|
+
const segments = from.slice(20).split("/").filter(Boolean);
|
|
121
|
+
const componentDir = segments[0];
|
|
122
|
+
const fileBase = segments.at(-1);
|
|
123
|
+
if (!componentDir || !fileBase) return;
|
|
124
|
+
const baseDir = `miniprogram_dist/${componentDir}`;
|
|
125
|
+
const base = `${baseDir}/${fileBase}`;
|
|
126
|
+
return {
|
|
127
|
+
packageName: "tdesign-miniprogram",
|
|
128
|
+
dts: [
|
|
129
|
+
`${baseDir}/type.d.ts`,
|
|
130
|
+
`${baseDir}/props.d.ts`,
|
|
131
|
+
`${base}.d.ts`,
|
|
132
|
+
`${baseDir}/index.d.ts`
|
|
133
|
+
],
|
|
134
|
+
js: [
|
|
135
|
+
`${baseDir}/type.js`,
|
|
136
|
+
`${baseDir}/props.js`,
|
|
137
|
+
`${base}.js`,
|
|
138
|
+
`${baseDir}/index.js`
|
|
139
|
+
]
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
};
|
|
159
143
|
};
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
init_esm_shims();
|
|
163
|
-
|
|
164
|
-
// src/auto-import-components/resolvers/vant.ts
|
|
165
|
-
init_esm_shims();
|
|
166
|
-
import { defu as defu2 } from "@weapp-core/shared";
|
|
167
|
-
|
|
168
|
-
// src/auto-import-components/resolvers/json/vant.json
|
|
144
|
+
//#endregion
|
|
145
|
+
//#region src/auto-import-components/resolvers/json/vant.json
|
|
169
146
|
var vant_default = [
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
147
|
+
"action-sheet",
|
|
148
|
+
"area",
|
|
149
|
+
"button",
|
|
150
|
+
"calendar",
|
|
151
|
+
"card",
|
|
152
|
+
"cascader",
|
|
153
|
+
"cell",
|
|
154
|
+
"cell-group",
|
|
155
|
+
"checkbox",
|
|
156
|
+
"checkbox-group",
|
|
157
|
+
"circle",
|
|
158
|
+
"col",
|
|
159
|
+
"collapse",
|
|
160
|
+
"collapse-item",
|
|
161
|
+
"config-provider",
|
|
162
|
+
"count-down",
|
|
163
|
+
"datetime-picker",
|
|
164
|
+
"definitions",
|
|
165
|
+
"dialog",
|
|
166
|
+
"divider",
|
|
167
|
+
"dropdown-item",
|
|
168
|
+
"dropdown-menu",
|
|
169
|
+
"empty",
|
|
170
|
+
"field",
|
|
171
|
+
"goods-action",
|
|
172
|
+
"goods-action-button",
|
|
173
|
+
"goods-action-icon",
|
|
174
|
+
"grid",
|
|
175
|
+
"grid-item",
|
|
176
|
+
"icon",
|
|
177
|
+
"image",
|
|
178
|
+
"index-anchor",
|
|
179
|
+
"index-bar",
|
|
180
|
+
"info",
|
|
181
|
+
"loading",
|
|
182
|
+
"nav-bar",
|
|
183
|
+
"notice-bar",
|
|
184
|
+
"notify",
|
|
185
|
+
"overlay",
|
|
186
|
+
"panel",
|
|
187
|
+
"picker",
|
|
188
|
+
"picker-column",
|
|
189
|
+
"popup",
|
|
190
|
+
"progress",
|
|
191
|
+
"radio",
|
|
192
|
+
"radio-group",
|
|
193
|
+
"rate",
|
|
194
|
+
"row",
|
|
195
|
+
"search",
|
|
196
|
+
"share-sheet",
|
|
197
|
+
"sidebar",
|
|
198
|
+
"sidebar-item",
|
|
199
|
+
"skeleton",
|
|
200
|
+
"slider",
|
|
201
|
+
"stepper",
|
|
202
|
+
"steps",
|
|
203
|
+
"sticky",
|
|
204
|
+
"submit-bar",
|
|
205
|
+
"swipe-cell",
|
|
206
|
+
"switch",
|
|
207
|
+
"tab",
|
|
208
|
+
"tabbar",
|
|
209
|
+
"tabbar-item",
|
|
210
|
+
"tabs",
|
|
211
|
+
"tag",
|
|
212
|
+
"toast",
|
|
213
|
+
"transition",
|
|
214
|
+
"tree-select",
|
|
215
|
+
"uploader"
|
|
239
216
|
];
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
`lib/${component}/index.d.ts`,
|
|
283
|
-
`dist/${component}/index.d.ts`
|
|
284
|
-
],
|
|
285
|
-
js: [
|
|
286
|
-
`lib/${component}/index.js`,
|
|
287
|
-
`dist/${component}/index.js`
|
|
288
|
-
]
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
};
|
|
292
|
-
return resolver;
|
|
217
|
+
//#endregion
|
|
218
|
+
//#region src/auto-import-components/resolvers/vant.ts
|
|
219
|
+
const defaultPrefix$1 = "van-";
|
|
220
|
+
const VantResolver = (opts) => {
|
|
221
|
+
const { prefix, resolve } = defu(opts, {
|
|
222
|
+
prefix: defaultPrefix$1,
|
|
223
|
+
resolve({ name, prefix }) {
|
|
224
|
+
return {
|
|
225
|
+
key: `${prefix}${name}`,
|
|
226
|
+
value: `@vant/weapp/${name}`
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
const map = vant_default.reduce((acc, cur) => {
|
|
231
|
+
const { key, value } = resolve({
|
|
232
|
+
name: cur,
|
|
233
|
+
prefix
|
|
234
|
+
});
|
|
235
|
+
acc[key] = value;
|
|
236
|
+
return acc;
|
|
237
|
+
}, {});
|
|
238
|
+
return {
|
|
239
|
+
components: Object.freeze({ ...map }),
|
|
240
|
+
resolve(componentName) {
|
|
241
|
+
const from = map[componentName];
|
|
242
|
+
if (!from) return;
|
|
243
|
+
return {
|
|
244
|
+
name: componentName,
|
|
245
|
+
from
|
|
246
|
+
};
|
|
247
|
+
},
|
|
248
|
+
resolveExternalMetadataCandidates(from) {
|
|
249
|
+
if (!from.startsWith("@vant/weapp/")) return;
|
|
250
|
+
const component = from.slice(12);
|
|
251
|
+
if (!component) return;
|
|
252
|
+
return {
|
|
253
|
+
packageName: "@vant/weapp",
|
|
254
|
+
dts: [`lib/${component}/index.d.ts`, `dist/${component}/index.d.ts`],
|
|
255
|
+
js: [`lib/${component}/index.js`, `dist/${component}/index.js`]
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
};
|
|
293
259
|
};
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
init_esm_shims();
|
|
297
|
-
import { defu as defu3 } from "@weapp-core/shared";
|
|
298
|
-
|
|
299
|
-
// src/auto-import-components/resolvers/json/weui.json
|
|
260
|
+
//#endregion
|
|
261
|
+
//#region src/auto-import-components/resolvers/json/weui.json
|
|
300
262
|
var weui_default = [
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
263
|
+
"actionsheet",
|
|
264
|
+
"badge",
|
|
265
|
+
"cell",
|
|
266
|
+
"cells",
|
|
267
|
+
"checkbox",
|
|
268
|
+
"checkbox-group",
|
|
269
|
+
"dialog",
|
|
270
|
+
"form",
|
|
271
|
+
"form-page",
|
|
272
|
+
"gallery",
|
|
273
|
+
"grids",
|
|
274
|
+
"half-screen-dialog",
|
|
275
|
+
"icon",
|
|
276
|
+
"loading",
|
|
277
|
+
"msg",
|
|
278
|
+
"navigation-bar",
|
|
279
|
+
"searchbar",
|
|
280
|
+
"slideview",
|
|
281
|
+
"tabbar",
|
|
282
|
+
"toptips",
|
|
283
|
+
"uploader"
|
|
322
284
|
];
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
};
|
|
356
|
-
export {
|
|
357
|
-
TDesignResolver,
|
|
358
|
-
VantResolver,
|
|
359
|
-
WeuiResolver
|
|
285
|
+
//#endregion
|
|
286
|
+
//#region src/auto-import-components/resolvers/weui.ts
|
|
287
|
+
const defaultPrefix = "mp-";
|
|
288
|
+
const WeuiResolver = (opts) => {
|
|
289
|
+
const { prefix, resolve } = defu(opts, {
|
|
290
|
+
prefix: defaultPrefix,
|
|
291
|
+
resolve({ name, prefix }) {
|
|
292
|
+
return {
|
|
293
|
+
key: `${prefix}${name}`,
|
|
294
|
+
value: `weui-miniprogram/${name}/${name}`
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
const map = weui_default.reduce((acc, cur) => {
|
|
299
|
+
const { key, value } = resolve({
|
|
300
|
+
name: cur,
|
|
301
|
+
prefix
|
|
302
|
+
});
|
|
303
|
+
acc[key] = value;
|
|
304
|
+
return acc;
|
|
305
|
+
}, {});
|
|
306
|
+
return {
|
|
307
|
+
components: Object.freeze({ ...map }),
|
|
308
|
+
resolve(componentName) {
|
|
309
|
+
const from = map[componentName];
|
|
310
|
+
if (!from) return;
|
|
311
|
+
return {
|
|
312
|
+
name: componentName,
|
|
313
|
+
from
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
};
|
|
360
317
|
};
|
|
318
|
+
//#endregion
|
|
319
|
+
export { TDesignResolver, VantResolver, WeuiResolver };
|