unplugin-vue-components 0.17.17 → 0.17.18
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/{chunk-UQDDEQB6.js → chunk-3EFXRPH2.js} +3 -3
- package/dist/{chunk-MQYF3NLA.mjs → chunk-QJTINFQL.mjs} +3 -3
- package/dist/esbuild.js +2 -2
- package/dist/esbuild.mjs +1 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +1 -1
- package/dist/nuxt.js +3 -3
- package/dist/nuxt.mjs +1 -1
- package/dist/rollup.js +2 -2
- package/dist/rollup.mjs +1 -1
- package/dist/vite.js +2 -2
- package/dist/vite.mjs +1 -1
- package/dist/webpack.js +2 -2
- package/dist/webpack.mjs +1 -1
- package/package.json +1 -1
|
@@ -108,7 +108,7 @@ function parseDeclaration(code) {
|
|
|
108
108
|
return {};
|
|
109
109
|
return Object.fromEntries(Array.from(code.matchAll(/(?<!\/\/)\s+\s+['"]?(.+?)['"]?:\s(.+?)\n/g)).map((i) => [i[1], i[2]]));
|
|
110
110
|
}
|
|
111
|
-
async function generateDeclaration(ctx, root, filepath) {
|
|
111
|
+
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;
|
|
@@ -125,7 +125,7 @@ async function generateDeclaration(ctx, root, filepath) {
|
|
|
125
125
|
return;
|
|
126
126
|
const originalContent = _fs.existsSync.call(void 0, filepath) ? await _fs.promises.readFile(filepath, "utf-8") : "";
|
|
127
127
|
const originalImports = parseDeclaration(originalContent);
|
|
128
|
-
const lines = Object.entries(_chunkHIJQIC5Vjs.__spreadValues.call(void 0, _chunkHIJQIC5Vjs.__spreadValues.call(void 0, {}, originalImports), imports)).sort((a, b) => a[0].localeCompare(b[0])).filter(([name]) => ctx.componentCustomMap[name] || ctx.componentNameMap[name]).map(([name, v]) => {
|
|
128
|
+
const lines = Object.entries(_chunkHIJQIC5Vjs.__spreadValues.call(void 0, _chunkHIJQIC5Vjs.__spreadValues.call(void 0, {}, originalImports), imports)).sort((a, b) => a[0].localeCompare(b[0])).filter(([name]) => removeUnused ? ctx.componentCustomMap[name] || ctx.componentNameMap[name] : true).map(([name, v]) => {
|
|
129
129
|
if (!/^\w+$/.test(name))
|
|
130
130
|
name = `'${name}'`;
|
|
131
131
|
return `${name}: ${v}`;
|
|
@@ -494,7 +494,7 @@ var Context = class {
|
|
|
494
494
|
if (!this.options.dts)
|
|
495
495
|
return;
|
|
496
496
|
debug5.decleration("generating");
|
|
497
|
-
generateDeclaration(this, this.options.root, this.options.dts);
|
|
497
|
+
generateDeclaration(this, this.options.root, this.options.dts, !this._server);
|
|
498
498
|
}
|
|
499
499
|
get componentNameMap() {
|
|
500
500
|
return this._componentNameMap;
|
|
@@ -108,7 +108,7 @@ function parseDeclaration(code) {
|
|
|
108
108
|
return {};
|
|
109
109
|
return Object.fromEntries(Array.from(code.matchAll(/(?<!\/\/)\s+\s+['"]?(.+?)['"]?:\s(.+?)\n/g)).map((i) => [i[1], i[2]]));
|
|
110
110
|
}
|
|
111
|
-
async function generateDeclaration(ctx, root, filepath) {
|
|
111
|
+
async function generateDeclaration(ctx, root, filepath, removeUnused = false) {
|
|
112
112
|
const imports = Object.fromEntries(Object.values(__spreadValues(__spreadValues({}, ctx.componentNameMap), ctx.componentCustomMap)).map(({ path, name, importName }) => {
|
|
113
113
|
if (!name)
|
|
114
114
|
return void 0;
|
|
@@ -125,7 +125,7 @@ async function generateDeclaration(ctx, root, filepath) {
|
|
|
125
125
|
return;
|
|
126
126
|
const originalContent = existsSync(filepath) ? await fs.readFile(filepath, "utf-8") : "";
|
|
127
127
|
const originalImports = parseDeclaration(originalContent);
|
|
128
|
-
const lines = Object.entries(__spreadValues(__spreadValues({}, originalImports), imports)).sort((a, b) => a[0].localeCompare(b[0])).filter(([name]) => ctx.componentCustomMap[name] || ctx.componentNameMap[name]).map(([name, v]) => {
|
|
128
|
+
const lines = Object.entries(__spreadValues(__spreadValues({}, originalImports), imports)).sort((a, b) => a[0].localeCompare(b[0])).filter(([name]) => removeUnused ? ctx.componentCustomMap[name] || ctx.componentNameMap[name] : true).map(([name, v]) => {
|
|
129
129
|
if (!/^\w+$/.test(name))
|
|
130
130
|
name = `'${name}'`;
|
|
131
131
|
return `${name}: ${v}`;
|
|
@@ -494,7 +494,7 @@ var Context = class {
|
|
|
494
494
|
if (!this.options.dts)
|
|
495
495
|
return;
|
|
496
496
|
debug5.decleration("generating");
|
|
497
|
-
generateDeclaration(this, this.options.root, this.options.dts);
|
|
497
|
+
generateDeclaration(this, this.options.root, this.options.dts, !this._server);
|
|
498
498
|
}
|
|
499
499
|
get componentNameMap() {
|
|
500
500
|
return this._componentNameMap;
|
package/dist/esbuild.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk3EFXRPH2js = require('./chunk-3EFXRPH2.js');
|
|
4
4
|
require('./chunk-42OWKG5W.js');
|
|
5
5
|
require('./chunk-GGNOJ77I.js');
|
|
6
6
|
require('./chunk-HIJQIC5V.js');
|
|
7
7
|
|
|
8
8
|
// src/esbuild.ts
|
|
9
|
-
var esbuild_default =
|
|
9
|
+
var esbuild_default = _chunk3EFXRPH2js.unplugin_default.esbuild;
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
module.exports = esbuild_default;
|
package/dist/esbuild.mjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk3EFXRPH2js = require('./chunk-3EFXRPH2.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -13,4 +13,4 @@ require('./chunk-HIJQIC5V.js');
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
exports.camelCase = _chunk42OWKG5Wjs.camelCase; exports.default =
|
|
16
|
+
exports.camelCase = _chunk42OWKG5Wjs.camelCase; exports.default = _chunk3EFXRPH2js.unplugin_default; exports.kebabCase = _chunk42OWKG5Wjs.kebabCase; exports.pascalCase = _chunk42OWKG5Wjs.pascalCase;
|
package/dist/index.mjs
CHANGED
package/dist/nuxt.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk3EFXRPH2js = require('./chunk-3EFXRPH2.js');
|
|
4
4
|
require('./chunk-42OWKG5W.js');
|
|
5
5
|
require('./chunk-GGNOJ77I.js');
|
|
6
6
|
require('./chunk-HIJQIC5V.js');
|
|
@@ -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(
|
|
12
|
+
config.plugins.unshift(_chunk3EFXRPH2js.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(
|
|
16
|
+
vite.config.plugins.push(_chunk3EFXRPH2js.unplugin_default.vite(options));
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
|
package/dist/nuxt.mjs
CHANGED
package/dist/rollup.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk3EFXRPH2js = require('./chunk-3EFXRPH2.js');
|
|
4
4
|
require('./chunk-42OWKG5W.js');
|
|
5
5
|
require('./chunk-GGNOJ77I.js');
|
|
6
6
|
require('./chunk-HIJQIC5V.js');
|
|
7
7
|
|
|
8
8
|
// src/rollup.ts
|
|
9
|
-
var rollup_default =
|
|
9
|
+
var rollup_default = _chunk3EFXRPH2js.unplugin_default.rollup;
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
module.exports = rollup_default;
|
package/dist/rollup.mjs
CHANGED
package/dist/vite.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk3EFXRPH2js = require('./chunk-3EFXRPH2.js');
|
|
4
4
|
require('./chunk-42OWKG5W.js');
|
|
5
5
|
require('./chunk-GGNOJ77I.js');
|
|
6
6
|
require('./chunk-HIJQIC5V.js');
|
|
7
7
|
|
|
8
8
|
// src/vite.ts
|
|
9
|
-
var vite_default =
|
|
9
|
+
var vite_default = _chunk3EFXRPH2js.unplugin_default.vite;
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
module.exports = vite_default;
|
package/dist/vite.mjs
CHANGED
package/dist/webpack.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk3EFXRPH2js = require('./chunk-3EFXRPH2.js');
|
|
4
4
|
require('./chunk-42OWKG5W.js');
|
|
5
5
|
require('./chunk-GGNOJ77I.js');
|
|
6
6
|
require('./chunk-HIJQIC5V.js');
|
|
7
7
|
|
|
8
8
|
// src/webpack.ts
|
|
9
|
-
var webpack_default =
|
|
9
|
+
var webpack_default = _chunk3EFXRPH2js.unplugin_default.webpack;
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
module.exports = webpack_default;
|
package/dist/webpack.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unplugin-vue-components",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.18",
|
|
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",
|