unplugin-vue-components 0.17.18 → 0.17.21

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.
@@ -9,7 +9,7 @@
9
9
 
10
10
 
11
11
 
12
- var _chunk42OWKG5Wjs = require('./chunk-42OWKG5W.js');
12
+ var _chunkERB4VV6Kjs = require('./chunk-ERB4VV6K.js');
13
13
 
14
14
 
15
15
 
@@ -49,7 +49,7 @@ function resolveOptions(options, root) {
49
49
  const resolved = Object.assign({}, defaultOptions, options);
50
50
  resolved.libraries = _utils.toArray.call(void 0, resolved.libraries).map((i) => typeof i === "string" ? { name: i } : i);
51
51
  resolved.resolvers = normalizeResolvers(resolved.resolvers);
52
- resolved.resolvers.push(...resolved.libraries.map((lib) => _chunk42OWKG5Wjs.LibraryResolver.call(void 0, lib)));
52
+ resolved.resolvers.push(...resolved.libraries.map((lib) => _chunkERB4VV6Kjs.LibraryResolver.call(void 0, lib)));
53
53
  resolved.extensions = _utils.toArray.call(void 0, resolved.extensions);
54
54
  if (resolved.globs) {
55
55
  resolved.globs = _utils.toArray.call(void 0, resolved.globs).map((glob) => _utils.slash.call(void 0, _path.resolve.call(void 0, root, glob)));
@@ -112,7 +112,7 @@ async function generateDeclaration(ctx, root, filepath, removeUnused = false) {
112
112
  const imports = Object.fromEntries(Object.values(_chunkHIJQIC5Vjs.__spreadValues.call(void 0, _chunkHIJQIC5Vjs.__spreadValues.call(void 0, {}, ctx.componentNameMap), ctx.componentCustomMap)).map(({ path, name, importName }) => {
113
113
  if (!name)
114
114
  return void 0;
115
- path = _chunk42OWKG5Wjs.getTransformedPath.call(void 0, path, ctx);
115
+ path = _chunkERB4VV6Kjs.getTransformedPath.call(void 0, path, ctx);
116
116
  const related = _path.isAbsolute.call(void 0, path) ? `./${_path.relative.call(void 0, _path.dirname.call(void 0, filepath), path)}` : path;
117
117
  let entry = `typeof import('${_utils.slash.call(void 0, related)}')`;
118
118
  if (importName)
@@ -188,12 +188,12 @@ async function transformComponent(code, transformer2, s, ctx, sfcPath) {
188
188
  const results = transformer2 === "vue2" ? resolveVue2(code, s) : resolveVue3(code, s);
189
189
  for (const { rawName, replace } of results) {
190
190
  debug2(`| ${rawName}`);
191
- const name = _chunk42OWKG5Wjs.pascalCase.call(void 0, rawName);
191
+ const name = _chunkERB4VV6Kjs.pascalCase.call(void 0, rawName);
192
192
  ctx.updateUsageMap(sfcPath, [name]);
193
193
  const component = await ctx.findComponent(name, "component", [sfcPath]);
194
194
  if (component) {
195
195
  const varName = `__unplugin_components_${no}`;
196
- s.prepend(`${_chunk42OWKG5Wjs.stringifyComponentImport.call(void 0, _chunkHIJQIC5Vjs.__spreadProps.call(void 0, _chunkHIJQIC5Vjs.__spreadValues.call(void 0, {}, component), { name: varName }), ctx)};
196
+ s.prepend(`${_chunkERB4VV6Kjs.stringifyComponentImport.call(void 0, _chunkHIJQIC5Vjs.__spreadProps.call(void 0, _chunkHIJQIC5Vjs.__spreadValues.call(void 0, {}, component), { name: varName }), ctx)};
197
197
  `);
198
198
  no += 1;
199
199
  replace(varName);
@@ -283,13 +283,13 @@ async function transformDirective(code, transformer2, s, ctx, sfcPath) {
283
283
  const results = await (transformer2 === "vue2" ? resolveVue22(code, s) : resolveVue32(code, s));
284
284
  for (const { rawName, replace } of results) {
285
285
  debug3(`| ${rawName}`);
286
- const name = _chunk42OWKG5Wjs.pascalCase.call(void 0, rawName);
286
+ const name = _chunkERB4VV6Kjs.pascalCase.call(void 0, rawName);
287
287
  ctx.updateUsageMap(sfcPath, [name]);
288
288
  const directive = await ctx.findComponent(name, "directive", [sfcPath]);
289
289
  if (!directive)
290
290
  continue;
291
291
  const varName = `__unplugin_directives_${no}`;
292
- s.prepend(`${_chunk42OWKG5Wjs.stringifyComponentImport.call(void 0, _chunkHIJQIC5Vjs.__spreadProps.call(void 0, _chunkHIJQIC5Vjs.__spreadValues.call(void 0, {}, directive), { name: varName }), ctx)};
292
+ s.prepend(`${_chunkERB4VV6Kjs.stringifyComponentImport.call(void 0, _chunkHIJQIC5Vjs.__spreadProps.call(void 0, _chunkHIJQIC5Vjs.__spreadValues.call(void 0, {}, directive), { name: varName }), ctx)};
293
293
  `);
294
294
  no += 1;
295
295
  replace(varName);
@@ -308,7 +308,7 @@ function transformer(ctx, transformer2) {
308
308
  await transformComponent(code, transformer2, s, ctx, sfcPath);
309
309
  if (ctx.options.directives)
310
310
  await transformDirective(code, transformer2, s, ctx, sfcPath);
311
- s.prepend(_chunk42OWKG5Wjs.DISABLE_COMMENT);
311
+ s.prepend(_chunkERB4VV6Kjs.DISABLE_COMMENT);
312
312
  const result = { code: s.toString() };
313
313
  if (ctx.sourcemap)
314
314
  result.map = s.generateMap({ source: id, includeContent: true });
@@ -352,7 +352,7 @@ var Context = class {
352
352
  this.transformer = transformer(this, name || "vue3");
353
353
  }
354
354
  transform(code, id) {
355
- const { path, query } = _chunk42OWKG5Wjs.parseId.call(void 0, id);
355
+ const { path, query } = _chunkERB4VV6Kjs.parseId.call(void 0, id);
356
356
  return this.transformer(code, id, path, query);
357
357
  }
358
358
  setupViteServer(server) {
@@ -364,14 +364,14 @@ var Context = class {
364
364
  setupWatcher(watcher) {
365
365
  const { globs } = this.options;
366
366
  watcher.on("unlink", (path) => {
367
- if (!_chunk42OWKG5Wjs.matchGlobs.call(void 0, path, globs))
367
+ if (!_chunkERB4VV6Kjs.matchGlobs.call(void 0, path, globs))
368
368
  return;
369
369
  path = _utils.slash.call(void 0, path);
370
370
  this.removeComponents(path);
371
371
  this.onUpdate(path);
372
372
  });
373
373
  watcher.on("add", (path) => {
374
- if (!_chunk42OWKG5Wjs.matchGlobs.call(void 0, path, globs))
374
+ if (!_chunkERB4VV6Kjs.matchGlobs.call(void 0, path, globs))
375
375
  return;
376
376
  path = _utils.slash.call(void 0, path);
377
377
  this.addComponents(path);
@@ -418,7 +418,7 @@ var Context = class {
418
418
  updates: []
419
419
  };
420
420
  const timestamp = +new Date();
421
- const name = _chunk42OWKG5Wjs.pascalCase.call(void 0, _chunk42OWKG5Wjs.getNameFromFilePath.call(void 0, path, this.options));
421
+ const name = _chunkERB4VV6Kjs.pascalCase.call(void 0, _chunkERB4VV6Kjs.getNameFromFilePath.call(void 0, path, this.options));
422
422
  Object.entries(this._componentUsageMap).forEach(([key, values]) => {
423
423
  if (values.has(name)) {
424
424
  const r = `/${_utils.slash.call(void 0, _path.relative.call(void 0, this.root, key))}`;
@@ -436,7 +436,7 @@ var Context = class {
436
436
  updateComponentNameMap() {
437
437
  this._componentNameMap = {};
438
438
  Array.from(this._componentPaths).forEach((path) => {
439
- const name = _chunk42OWKG5Wjs.pascalCase.call(void 0, _chunk42OWKG5Wjs.getNameFromFilePath.call(void 0, path, this.options));
439
+ const name = _chunkERB4VV6Kjs.pascalCase.call(void 0, _chunkERB4VV6Kjs.getNameFromFilePath.call(void 0, path, this.options));
440
440
  if (this._componentNameMap[name] && !this.options.allowOverrides) {
441
441
  console.warn(`[unplugin-vue-components] component "${name}"(${path}) has naming conflicts with other components, ignored.`);
442
442
  return;
@@ -476,7 +476,7 @@ var Context = class {
476
476
  }
477
477
  normalizePath(path) {
478
478
  var _a, _b, _c;
479
- return _chunk42OWKG5Wjs.resolveAlias.call(void 0, path, ((_b = (_a = this.viteConfig) == null ? void 0 : _a.resolve) == null ? void 0 : _b.alias) || ((_c = this.viteConfig) == null ? void 0 : _c.alias) || []);
479
+ return _chunkERB4VV6Kjs.resolveAlias.call(void 0, path, ((_b = (_a = this.viteConfig) == null ? void 0 : _a.resolve) == null ? void 0 : _b.alias) || ((_c = this.viteConfig) == null ? void 0 : _c.alias) || []);
480
480
  }
481
481
  relative(path) {
482
482
  if (path.startsWith("/") && !path.startsWith(this.root))
@@ -515,7 +515,7 @@ var unplugin_default = _unplugin.createUnplugin.call(void 0, (options = {}) => {
515
515
  return filter(id);
516
516
  },
517
517
  async transform(code, id) {
518
- if (!_chunk42OWKG5Wjs.shouldTransform.call(void 0, code))
518
+ if (!_chunkERB4VV6Kjs.shouldTransform.call(void 0, code))
519
519
  return null;
520
520
  try {
521
521
  const result = await ctx.transform(code, id);
@@ -12,6 +12,7 @@ var _localpkg = require('local-pkg');
12
12
  var DISABLE_COMMENT = "/* unplugin-vue-components disabled */";
13
13
 
14
14
  // src/core/utils.ts
15
+ var isSSR = Boolean(process.env.SSR || process.env.SSG || process.env.VITE_SSR || process.env.VITE_SSG);
15
16
  function pascalCase(str) {
16
17
  return capitalize(camelCase(str));
17
18
  }
@@ -211,4 +212,5 @@ function LibraryResolver(options) {
211
212
 
212
213
 
213
214
 
214
- exports.DISABLE_COMMENT = DISABLE_COMMENT; exports.pascalCase = pascalCase; exports.camelCase = camelCase; exports.kebabCase = kebabCase; exports.parseId = parseId; exports.matchGlobs = matchGlobs; exports.getTransformedPath = getTransformedPath; exports.stringifyComponentImport = stringifyComponentImport; exports.getNameFromFilePath = getNameFromFilePath; exports.resolveAlias = resolveAlias; exports.getPkgVersion = getPkgVersion; exports.shouldTransform = shouldTransform; exports.resolveImportPath = resolveImportPath; exports.tryLoadVeturTags = tryLoadVeturTags; exports.LibraryResolver = LibraryResolver;
215
+
216
+ exports.DISABLE_COMMENT = DISABLE_COMMENT; exports.isSSR = isSSR; exports.pascalCase = pascalCase; exports.camelCase = camelCase; exports.kebabCase = kebabCase; exports.parseId = parseId; exports.matchGlobs = matchGlobs; exports.getTransformedPath = getTransformedPath; exports.stringifyComponentImport = stringifyComponentImport; exports.getNameFromFilePath = getNameFromFilePath; exports.resolveAlias = resolveAlias; exports.getPkgVersion = getPkgVersion; exports.shouldTransform = shouldTransform; exports.resolveImportPath = resolveImportPath; exports.tryLoadVeturTags = tryLoadVeturTags; exports.LibraryResolver = LibraryResolver;
@@ -12,6 +12,7 @@ import {
12
12
  var DISABLE_COMMENT = "/* unplugin-vue-components disabled */";
13
13
 
14
14
  // src/core/utils.ts
15
+ var isSSR = Boolean(process.env.SSR || process.env.SSG || process.env.VITE_SSR || process.env.VITE_SSG);
15
16
  function pascalCase(str) {
16
17
  return capitalize(camelCase(str));
17
18
  }
@@ -197,6 +198,7 @@ function LibraryResolver(options) {
197
198
 
198
199
  export {
199
200
  DISABLE_COMMENT,
201
+ isSSR,
200
202
  pascalCase,
201
203
  camelCase,
202
204
  kebabCase,
@@ -9,7 +9,7 @@ import {
9
9
  resolveAlias,
10
10
  shouldTransform,
11
11
  stringifyComponentImport
12
- } from "./chunk-V5TNASXD.mjs";
12
+ } from "./chunk-M3Z4TUEC.mjs";
13
13
  import {
14
14
  __require,
15
15
  __spreadProps,
package/dist/esbuild.js CHANGED
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk3EFXRPH2js = require('./chunk-3EFXRPH2.js');
4
- require('./chunk-42OWKG5W.js');
3
+ var _chunk4OXKGUF4js = require('./chunk-4OXKGUF4.js');
4
+ require('./chunk-ERB4VV6K.js');
5
5
  require('./chunk-GGNOJ77I.js');
6
6
  require('./chunk-HIJQIC5V.js');
7
7
 
8
8
  // src/esbuild.ts
9
- var esbuild_default = _chunk3EFXRPH2js.unplugin_default.esbuild;
9
+ var esbuild_default = _chunk4OXKGUF4js.unplugin_default.esbuild;
10
10
 
11
11
 
12
12
  module.exports = esbuild_default;
package/dist/esbuild.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  unplugin_default
3
- } from "./chunk-QJTINFQL.mjs";
4
- import "./chunk-V5TNASXD.mjs";
3
+ } from "./chunk-ZHBFA55Z.mjs";
4
+ import "./chunk-M3Z4TUEC.mjs";
5
5
  import "./chunk-WBQAMGXK.mjs";
6
6
  import "./chunk-EKXJN6YJ.mjs";
7
7
 
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk3EFXRPH2js = require('./chunk-3EFXRPH2.js');
3
+ var _chunk4OXKGUF4js = require('./chunk-4OXKGUF4.js');
4
4
 
5
5
 
6
6
 
7
7
 
8
- var _chunk42OWKG5Wjs = require('./chunk-42OWKG5W.js');
8
+ var _chunkERB4VV6Kjs = require('./chunk-ERB4VV6K.js');
9
9
  require('./chunk-GGNOJ77I.js');
10
10
  require('./chunk-HIJQIC5V.js');
11
11
 
@@ -13,4 +13,4 @@ require('./chunk-HIJQIC5V.js');
13
13
 
14
14
 
15
15
 
16
- exports.camelCase = _chunk42OWKG5Wjs.camelCase; exports.default = _chunk3EFXRPH2js.unplugin_default; exports.kebabCase = _chunk42OWKG5Wjs.kebabCase; exports.pascalCase = _chunk42OWKG5Wjs.pascalCase;
16
+ exports.camelCase = _chunkERB4VV6Kjs.camelCase; exports.default = _chunk4OXKGUF4js.unplugin_default; exports.kebabCase = _chunkERB4VV6Kjs.kebabCase; exports.pascalCase = _chunkERB4VV6Kjs.pascalCase;
package/dist/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  unplugin_default
3
- } from "./chunk-QJTINFQL.mjs";
3
+ } from "./chunk-ZHBFA55Z.mjs";
4
4
  import {
5
5
  camelCase,
6
6
  kebabCase,
7
7
  pascalCase
8
- } from "./chunk-V5TNASXD.mjs";
8
+ } from "./chunk-M3Z4TUEC.mjs";
9
9
  import "./chunk-WBQAMGXK.mjs";
10
10
  import "./chunk-EKXJN6YJ.mjs";
11
11
  export {
package/dist/nuxt.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk3EFXRPH2js = require('./chunk-3EFXRPH2.js');
4
- require('./chunk-42OWKG5W.js');
3
+ var _chunk4OXKGUF4js = require('./chunk-4OXKGUF4.js');
4
+ require('./chunk-ERB4VV6K.js');
5
5
  require('./chunk-GGNOJ77I.js');
6
6
  require('./chunk-HIJQIC5V.js');
7
7
 
@@ -9,11 +9,11 @@ require('./chunk-HIJQIC5V.js');
9
9
  function nuxt_default(options) {
10
10
  this.extendBuild((config) => {
11
11
  config.plugins = config.plugins || [];
12
- config.plugins.unshift(_chunk3EFXRPH2js.unplugin_default.webpack(options));
12
+ config.plugins.unshift(_chunk4OXKGUF4js.unplugin_default.webpack(options));
13
13
  });
14
14
  this.nuxt.hook("vite:extend", async (vite) => {
15
15
  vite.config.plugins = vite.config.plugins || [];
16
- vite.config.plugins.push(_chunk3EFXRPH2js.unplugin_default.vite(options));
16
+ vite.config.plugins.push(_chunk4OXKGUF4js.unplugin_default.vite(options));
17
17
  });
18
18
  }
19
19
 
package/dist/nuxt.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  unplugin_default
3
- } from "./chunk-QJTINFQL.mjs";
4
- import "./chunk-V5TNASXD.mjs";
3
+ } from "./chunk-ZHBFA55Z.mjs";
4
+ import "./chunk-M3Z4TUEC.mjs";
5
5
  import "./chunk-WBQAMGXK.mjs";
6
6
  import "./chunk-EKXJN6YJ.mjs";
7
7
 
package/dist/resolvers.js CHANGED
@@ -6,7 +6,8 @@
6
6
 
7
7
 
8
8
 
9
- var _chunk42OWKG5Wjs = require('./chunk-42OWKG5W.js');
9
+
10
+ var _chunkERB4VV6Kjs = require('./chunk-ERB4VV6K.js');
10
11
 
11
12
 
12
13
 
@@ -1312,7 +1313,7 @@ function getStyleDir(compName) {
1312
1313
  }
1313
1314
  }
1314
1315
  if (!styleDir)
1315
- styleDir = _chunk42OWKG5Wjs.kebabCase.call(void 0, compName);
1316
+ styleDir = _chunkERB4VV6Kjs.kebabCase.call(void 0, compName);
1316
1317
  return styleDir;
1317
1318
  }
1318
1319
  function getSideEffects(compName, options) {
@@ -1491,7 +1492,7 @@ function resolveComponent(name, options) {
1491
1492
  return;
1492
1493
  if (!name.match(/^El[A-Z]/))
1493
1494
  return;
1494
- const partialName = _chunk42OWKG5Wjs.kebabCase.call(void 0, name.slice(2));
1495
+ const partialName = _chunkERB4VV6Kjs.kebabCase.call(void 0, name.slice(2));
1495
1496
  const { version, ssr } = options;
1496
1497
  if (compareVersions.compare(version, "1.1.0-beta.1", ">=")) {
1497
1498
  return {
@@ -1538,7 +1539,7 @@ function ElementPlusResolver(options = {}) {
1538
1539
  return optionsResolved;
1539
1540
  optionsResolved = _chunkHIJQIC5Vjs.__spreadValues.call(void 0, {
1540
1541
  ssr: false,
1541
- version: await _chunk42OWKG5Wjs.getPkgVersion.call(void 0, "element-plus", "1.1.0-beta.21"),
1542
+ version: await _chunkERB4VV6Kjs.getPkgVersion.call(void 0, "element-plus", "1.1.0-beta.21"),
1542
1543
  importStyle: "css",
1543
1544
  directives: true,
1544
1545
  exclude: void 0
@@ -1582,9 +1583,9 @@ function ElementUiResolver(options = {}) {
1582
1583
  return {
1583
1584
  type: "component",
1584
1585
  resolve: (name) => {
1585
- if (name.startsWith("El")) {
1586
+ if (/^El[A-Z]/.test(name)) {
1586
1587
  const compName = name.slice(2);
1587
- const partialName = _chunk42OWKG5Wjs.kebabCase.call(void 0, compName);
1588
+ const partialName = _chunkERB4VV6Kjs.kebabCase.call(void 0, compName);
1588
1589
  if (partialName === "collapse-transition") {
1589
1590
  return {
1590
1591
  path: `element-ui/lib/transitions/${partialName}`
@@ -1685,7 +1686,7 @@ function IduxResolver(options = {}) {
1685
1686
  let dirname = specialComponents[name];
1686
1687
  if (!dirname) {
1687
1688
  const nameIndex = packageName === "pro" ? 2 : 1;
1688
- dirname = _chunk42OWKG5Wjs.kebabCase.call(void 0, name).split("-")[nameIndex];
1689
+ dirname = _chunkERB4VV6Kjs.kebabCase.call(void 0, name).split("-")[nameIndex];
1689
1690
  }
1690
1691
  const path = `@idux/${packageName}/${dirname}`;
1691
1692
  let sideEffects;
@@ -1851,15 +1852,16 @@ function PrimeVueResolver(options = {}) {
1851
1852
  }
1852
1853
 
1853
1854
  // src/core/resolvers/vant.ts
1855
+ var moduleType = _chunkERB4VV6Kjs.isSSR ? "lib" : "es";
1854
1856
  function getSideEffects4(dirName, options) {
1855
1857
  const { importStyle = true } = options;
1856
- if (!importStyle)
1858
+ if (!importStyle || _chunkERB4VV6Kjs.isSSR)
1857
1859
  return;
1858
1860
  if (importStyle === "less")
1859
- return `vant/es/${dirName}/style/less`;
1861
+ return `vant/${moduleType}/${dirName}/style/less`;
1860
1862
  if (importStyle === "css")
1861
- return `vant/es/${dirName}/style/index`;
1862
- return `vant/es/${dirName}/style/index`;
1863
+ return `vant/${moduleType}/${dirName}/style/index`;
1864
+ return `vant/${moduleType}/${dirName}/style/index`;
1863
1865
  }
1864
1866
  function VantResolver(options = {}) {
1865
1867
  return {
@@ -1869,8 +1871,8 @@ function VantResolver(options = {}) {
1869
1871
  const partialName = name.slice(3);
1870
1872
  return {
1871
1873
  importName: partialName,
1872
- path: "vant/es",
1873
- sideEffects: getSideEffects4(_chunk42OWKG5Wjs.kebabCase.call(void 0, partialName), options)
1874
+ path: `vant/${moduleType}`,
1875
+ sideEffects: getSideEffects4(_chunkERB4VV6Kjs.kebabCase.call(void 0, partialName), options)
1874
1876
  };
1875
1877
  }
1876
1878
  }
@@ -1887,9 +1889,9 @@ function getResolved(name, options) {
1887
1889
  const sideEffects = [];
1888
1890
  if (importStyle || importCss) {
1889
1891
  if (importStyle === "less" || importLess)
1890
- sideEffects.push(`@varlet/ui/es/${_chunk42OWKG5Wjs.kebabCase.call(void 0, name)}/style/less.js`);
1892
+ sideEffects.push(`@varlet/ui/es/${_chunkERB4VV6Kjs.kebabCase.call(void 0, name)}/style/less.js`);
1891
1893
  else
1892
- sideEffects.push(`@varlet/ui/es/${_chunk42OWKG5Wjs.kebabCase.call(void 0, name)}/style`);
1894
+ sideEffects.push(`@varlet/ui/es/${_chunkERB4VV6Kjs.kebabCase.call(void 0, name)}/style`);
1893
1895
  }
1894
1896
  return {
1895
1897
  path: "@varlet/ui",
@@ -1946,15 +1948,15 @@ function VeuiResolver(options) {
1946
1948
  };
1947
1949
  }
1948
1950
  var formatters = {
1949
- "kebab-case": _chunk42OWKG5Wjs.kebabCase,
1950
- "camelCase": _chunk42OWKG5Wjs.camelCase,
1951
- "PascalCase": _chunk42OWKG5Wjs.pascalCase
1951
+ "kebab-case": _chunkERB4VV6Kjs.kebabCase,
1952
+ "camelCase": _chunkERB4VV6Kjs.camelCase,
1953
+ "PascalCase": _chunkERB4VV6Kjs.pascalCase
1952
1954
  };
1953
1955
  var peerPaths = new Map();
1954
1956
  function assertPeerPath(peerPath) {
1955
1957
  if (!peerPaths.has(peerPath)) {
1956
1958
  try {
1957
- _chunk42OWKG5Wjs.resolveImportPath.call(void 0, peerPath);
1959
+ _chunkERB4VV6Kjs.resolveImportPath.call(void 0, peerPath);
1958
1960
  peerPaths.set(peerPath, true);
1959
1961
  } catch (e) {
1960
1962
  peerPaths.set(peerPath, false);
@@ -2006,12 +2008,12 @@ function getCompDir(compName) {
2006
2008
  for (let i = 0; i < total; i++) {
2007
2009
  const matcher = matchComponents2[i];
2008
2010
  if (compName.match(matcher.pattern)) {
2009
- compPath = `${matcher.compDir}/${_chunk42OWKG5Wjs.kebabCase.call(void 0, compName)}.vue`;
2011
+ compPath = `${matcher.compDir}/${_chunkERB4VV6Kjs.kebabCase.call(void 0, compName)}.vue`;
2010
2012
  break;
2011
2013
  }
2012
2014
  }
2013
2015
  if (!compPath)
2014
- compPath = _chunk42OWKG5Wjs.kebabCase.call(void 0, compName);
2016
+ compPath = _chunkERB4VV6Kjs.kebabCase.call(void 0, compName);
2015
2017
  return compPath;
2016
2018
  }
2017
2019
  function ViewUiResolver() {
@@ -2102,7 +2104,7 @@ function getSideEffects7(name) {
2102
2104
  function componentsResolver(name) {
2103
2105
  if (!name.match(/^D[A-Z]/))
2104
2106
  return;
2105
- const resolveId = _chunk42OWKG5Wjs.kebabCase.call(void 0, name = name.slice(1));
2107
+ const resolveId = _chunkERB4VV6Kjs.kebabCase.call(void 0, name = name.slice(1));
2106
2108
  return {
2107
2109
  path: LIB_NAME,
2108
2110
  importName: name,
@@ -2238,7 +2240,7 @@ var matchComponents3 = [
2238
2240
  function getComponentStyleDir(importName, importStyle) {
2239
2241
  if (["ConfigProvider", "Icon"].includes(importName))
2240
2242
  return void 0;
2241
- let componentDir = _chunk42OWKG5Wjs.kebabCase.call(void 0, importName);
2243
+ let componentDir = _chunkERB4VV6Kjs.kebabCase.call(void 0, importName);
2242
2244
  for (const item of matchComponents3) {
2243
2245
  if (item.pattern.test(importName)) {
2244
2246
  componentDir = item.componentDir;
@@ -2261,7 +2263,7 @@ function ArcoResolver(options = {}) {
2261
2263
  path: "@arco-design/web-vue/es/icon"
2262
2264
  };
2263
2265
  }
2264
- if (name.match(/^A/)) {
2266
+ if (name.match(/^A[A-Z]/)) {
2265
2267
  const importStyle = (_a = options.importStyle) != null ? _a : "css";
2266
2268
  const importName = name.slice(1);
2267
2269
  return {
@@ -2277,15 +2279,33 @@ function ArcoResolver(options = {}) {
2277
2279
  // src/core/resolvers/tdesign.ts
2278
2280
  function getSideEffects8(importName, options) {
2279
2281
  const { library = "vue", importStyle = "css" } = options;
2280
- let fileName = _chunk42OWKG5Wjs.kebabCase.call(void 0, importName);
2282
+ let fileName = _chunkERB4VV6Kjs.kebabCase.call(void 0, importName);
2281
2283
  if (!importStyle)
2282
2284
  return;
2283
- if (fileName === "config-provider")
2285
+ if (["config-provider", "icon"].includes(fileName))
2284
2286
  return;
2285
- if (fileName === "radio-group" || fileName === "radio-button")
2286
- fileName = "radio";
2287
- if (fileName === "form-item")
2288
- fileName = "form";
2287
+ if (fileName.includes("-") && fileName !== "input-number") {
2288
+ const prefix2 = fileName.slice(0, fileName.indexOf("-"));
2289
+ const container = ["anchor", "avatar", "breadcrumb", "checkbox", "dropdown", "form", "input", "list", "menu", "radio", "slider", "steps", "swiper"];
2290
+ if (container.includes(prefix2))
2291
+ fileName = prefix2;
2292
+ }
2293
+ if (["row", "col"].includes(fileName))
2294
+ fileName = "grid";
2295
+ if (fileName === "addon")
2296
+ fileName = "input";
2297
+ if (["aside", "layout", "header", "footer", "content"].includes(fileName))
2298
+ fileName = "layout";
2299
+ if (fileName === "head-menu")
2300
+ fileName = "menu";
2301
+ if (["option", "option-group"].includes(fileName))
2302
+ fileName = "select";
2303
+ if (["tab-nav", "tab-panel"].includes(fileName))
2304
+ fileName = "tabs";
2305
+ if (fileName === "check-tag")
2306
+ fileName = "tag";
2307
+ if (fileName === "time-range-picker")
2308
+ fileName = "time-picker";
2289
2309
  if (importStyle === "less")
2290
2310
  return `tdesign-${library}/esm/${fileName}/style`;
2291
2311
  return `tdesign-${library}/es/${fileName}/style`;
@@ -2334,5 +2354,5 @@ function TDesignResolver(options = {}) {
2334
2354
 
2335
2355
 
2336
2356
 
2337
- exports.AntDesignVueResolver = AntDesignVueResolver; exports.ArcoResolver = ArcoResolver; exports.DevUiResolver = DevUiResolver; exports.ElementPlusResolver = ElementPlusResolver; exports.ElementUiResolver = ElementUiResolver; exports.HeadlessUiResolver = HeadlessUiResolver; exports.IduxResolver = IduxResolver; exports.InklineResolver = InklineResolver; exports.LibraryResolver = _chunk42OWKG5Wjs.LibraryResolver; exports.NaiveUiResolver = NaiveUiResolver; exports.PrimeVueResolver = PrimeVueResolver; exports.QuasarResolver = QuasarResolver; exports.TDesignResolver = TDesignResolver; exports.VantResolver = VantResolver; exports.VarletUIResolver = VarletUIResolver; exports.VeuiResolver = VeuiResolver; exports.ViewUiResolver = ViewUiResolver; exports.VueUseComponentsResolver = VueUseComponentsResolver; exports.VuetifyResolver = VuetifyResolver; exports.getResolved = getResolved; exports.tryLoadVeturTags = _chunk42OWKG5Wjs.tryLoadVeturTags;
2357
+ exports.AntDesignVueResolver = AntDesignVueResolver; exports.ArcoResolver = ArcoResolver; exports.DevUiResolver = DevUiResolver; exports.ElementPlusResolver = ElementPlusResolver; exports.ElementUiResolver = ElementUiResolver; exports.HeadlessUiResolver = HeadlessUiResolver; exports.IduxResolver = IduxResolver; exports.InklineResolver = InklineResolver; exports.LibraryResolver = _chunkERB4VV6Kjs.LibraryResolver; exports.NaiveUiResolver = NaiveUiResolver; exports.PrimeVueResolver = PrimeVueResolver; exports.QuasarResolver = QuasarResolver; exports.TDesignResolver = TDesignResolver; exports.VantResolver = VantResolver; exports.VarletUIResolver = VarletUIResolver; exports.VeuiResolver = VeuiResolver; exports.ViewUiResolver = ViewUiResolver; exports.VueUseComponentsResolver = VueUseComponentsResolver; exports.VuetifyResolver = VuetifyResolver; exports.getResolved = getResolved; exports.tryLoadVeturTags = _chunkERB4VV6Kjs.tryLoadVeturTags;
2338
2358
  exports.default = module.exports;
@@ -2,11 +2,12 @@ import {
2
2
  LibraryResolver,
3
3
  camelCase,
4
4
  getPkgVersion,
5
+ isSSR,
5
6
  kebabCase,
6
7
  pascalCase,
7
8
  resolveImportPath,
8
9
  tryLoadVeturTags
9
- } from "./chunk-V5TNASXD.mjs";
10
+ } from "./chunk-M3Z4TUEC.mjs";
10
11
  import {
11
12
  __commonJS,
12
13
  __require,
@@ -1582,7 +1583,7 @@ function ElementUiResolver(options = {}) {
1582
1583
  return {
1583
1584
  type: "component",
1584
1585
  resolve: (name) => {
1585
- if (name.startsWith("El")) {
1586
+ if (/^El[A-Z]/.test(name)) {
1586
1587
  const compName = name.slice(2);
1587
1588
  const partialName = kebabCase(compName);
1588
1589
  if (partialName === "collapse-transition") {
@@ -1851,15 +1852,16 @@ function PrimeVueResolver(options = {}) {
1851
1852
  }
1852
1853
 
1853
1854
  // src/core/resolvers/vant.ts
1855
+ var moduleType = isSSR ? "lib" : "es";
1854
1856
  function getSideEffects4(dirName, options) {
1855
1857
  const { importStyle = true } = options;
1856
- if (!importStyle)
1858
+ if (!importStyle || isSSR)
1857
1859
  return;
1858
1860
  if (importStyle === "less")
1859
- return `vant/es/${dirName}/style/less`;
1861
+ return `vant/${moduleType}/${dirName}/style/less`;
1860
1862
  if (importStyle === "css")
1861
- return `vant/es/${dirName}/style/index`;
1862
- return `vant/es/${dirName}/style/index`;
1863
+ return `vant/${moduleType}/${dirName}/style/index`;
1864
+ return `vant/${moduleType}/${dirName}/style/index`;
1863
1865
  }
1864
1866
  function VantResolver(options = {}) {
1865
1867
  return {
@@ -1869,7 +1871,7 @@ function VantResolver(options = {}) {
1869
1871
  const partialName = name.slice(3);
1870
1872
  return {
1871
1873
  importName: partialName,
1872
- path: "vant/es",
1874
+ path: `vant/${moduleType}`,
1873
1875
  sideEffects: getSideEffects4(kebabCase(partialName), options)
1874
1876
  };
1875
1877
  }
@@ -2261,7 +2263,7 @@ function ArcoResolver(options = {}) {
2261
2263
  path: "@arco-design/web-vue/es/icon"
2262
2264
  };
2263
2265
  }
2264
- if (name.match(/^A/)) {
2266
+ if (name.match(/^A[A-Z]/)) {
2265
2267
  const importStyle = (_a = options.importStyle) != null ? _a : "css";
2266
2268
  const importName = name.slice(1);
2267
2269
  return {
@@ -2280,12 +2282,30 @@ function getSideEffects8(importName, options) {
2280
2282
  let fileName = kebabCase(importName);
2281
2283
  if (!importStyle)
2282
2284
  return;
2283
- if (fileName === "config-provider")
2285
+ if (["config-provider", "icon"].includes(fileName))
2284
2286
  return;
2285
- if (fileName === "radio-group" || fileName === "radio-button")
2286
- fileName = "radio";
2287
- if (fileName === "form-item")
2288
- fileName = "form";
2287
+ if (fileName.includes("-") && fileName !== "input-number") {
2288
+ const prefix2 = fileName.slice(0, fileName.indexOf("-"));
2289
+ const container = ["anchor", "avatar", "breadcrumb", "checkbox", "dropdown", "form", "input", "list", "menu", "radio", "slider", "steps", "swiper"];
2290
+ if (container.includes(prefix2))
2291
+ fileName = prefix2;
2292
+ }
2293
+ if (["row", "col"].includes(fileName))
2294
+ fileName = "grid";
2295
+ if (fileName === "addon")
2296
+ fileName = "input";
2297
+ if (["aside", "layout", "header", "footer", "content"].includes(fileName))
2298
+ fileName = "layout";
2299
+ if (fileName === "head-menu")
2300
+ fileName = "menu";
2301
+ if (["option", "option-group"].includes(fileName))
2302
+ fileName = "select";
2303
+ if (["tab-nav", "tab-panel"].includes(fileName))
2304
+ fileName = "tabs";
2305
+ if (fileName === "check-tag")
2306
+ fileName = "tag";
2307
+ if (fileName === "time-range-picker")
2308
+ fileName = "time-picker";
2289
2309
  if (importStyle === "less")
2290
2310
  return `tdesign-${library}/esm/${fileName}/style`;
2291
2311
  return `tdesign-${library}/es/${fileName}/style`;
package/dist/rollup.js CHANGED
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk3EFXRPH2js = require('./chunk-3EFXRPH2.js');
4
- require('./chunk-42OWKG5W.js');
3
+ var _chunk4OXKGUF4js = require('./chunk-4OXKGUF4.js');
4
+ require('./chunk-ERB4VV6K.js');
5
5
  require('./chunk-GGNOJ77I.js');
6
6
  require('./chunk-HIJQIC5V.js');
7
7
 
8
8
  // src/rollup.ts
9
- var rollup_default = _chunk3EFXRPH2js.unplugin_default.rollup;
9
+ var rollup_default = _chunk4OXKGUF4js.unplugin_default.rollup;
10
10
 
11
11
 
12
12
  module.exports = rollup_default;
package/dist/rollup.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  unplugin_default
3
- } from "./chunk-QJTINFQL.mjs";
4
- import "./chunk-V5TNASXD.mjs";
3
+ } from "./chunk-ZHBFA55Z.mjs";
4
+ import "./chunk-M3Z4TUEC.mjs";
5
5
  import "./chunk-WBQAMGXK.mjs";
6
6
  import "./chunk-EKXJN6YJ.mjs";
7
7
 
package/dist/vite.js CHANGED
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk3EFXRPH2js = require('./chunk-3EFXRPH2.js');
4
- require('./chunk-42OWKG5W.js');
3
+ var _chunk4OXKGUF4js = require('./chunk-4OXKGUF4.js');
4
+ require('./chunk-ERB4VV6K.js');
5
5
  require('./chunk-GGNOJ77I.js');
6
6
  require('./chunk-HIJQIC5V.js');
7
7
 
8
8
  // src/vite.ts
9
- var vite_default = _chunk3EFXRPH2js.unplugin_default.vite;
9
+ var vite_default = _chunk4OXKGUF4js.unplugin_default.vite;
10
10
 
11
11
 
12
12
  module.exports = vite_default;
package/dist/vite.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  unplugin_default
3
- } from "./chunk-QJTINFQL.mjs";
4
- import "./chunk-V5TNASXD.mjs";
3
+ } from "./chunk-ZHBFA55Z.mjs";
4
+ import "./chunk-M3Z4TUEC.mjs";
5
5
  import "./chunk-WBQAMGXK.mjs";
6
6
  import "./chunk-EKXJN6YJ.mjs";
7
7
 
package/dist/webpack.js CHANGED
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk3EFXRPH2js = require('./chunk-3EFXRPH2.js');
4
- require('./chunk-42OWKG5W.js');
3
+ var _chunk4OXKGUF4js = require('./chunk-4OXKGUF4.js');
4
+ require('./chunk-ERB4VV6K.js');
5
5
  require('./chunk-GGNOJ77I.js');
6
6
  require('./chunk-HIJQIC5V.js');
7
7
 
8
8
  // src/webpack.ts
9
- var webpack_default = _chunk3EFXRPH2js.unplugin_default.webpack;
9
+ var webpack_default = _chunk4OXKGUF4js.unplugin_default.webpack;
10
10
 
11
11
 
12
12
  module.exports = webpack_default;
package/dist/webpack.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  unplugin_default
3
- } from "./chunk-QJTINFQL.mjs";
4
- import "./chunk-V5TNASXD.mjs";
3
+ } from "./chunk-ZHBFA55Z.mjs";
4
+ import "./chunk-M3Z4TUEC.mjs";
5
5
  import "./chunk-WBQAMGXK.mjs";
6
6
  import "./chunk-EKXJN6YJ.mjs";
7
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unplugin-vue-components",
3
- "version": "0.17.18",
3
+ "version": "0.17.21",
4
4
  "description": "Components auto importing for Vue",
5
5
  "homepage": "https://github.com/antfu/unplugin-vue-components",
6
6
  "bugs": "https://github.com/antfu/unplugin-vue-components/issues",