unplugin-vue-components 28.2.0 → 28.3.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/dist/{chunk-DBJDTE6J.cjs → chunk-QKHJKWZT.cjs} +12 -5
- package/dist/{chunk-OSRKQKTH.js → chunk-ZEYMMBWZ.js} +12 -5
- package/dist/esbuild.cjs +2 -2
- package/dist/esbuild.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/dist/nuxt.cjs +3 -3
- package/dist/nuxt.js +1 -1
- package/dist/rollup.cjs +2 -2
- package/dist/rollup.js +1 -1
- package/dist/rspack.cjs +2 -2
- package/dist/rspack.js +1 -1
- package/dist/types.d.cts +9 -0
- package/dist/types.d.ts +9 -0
- package/dist/vite.cjs +2 -2
- package/dist/vite.js +1 -1
- package/dist/webpack.cjs +2 -2
- package/dist/webpack.js +1 -1
- package/package.json +1 -1
|
@@ -197,6 +197,7 @@ var defaultOptions = {
|
|
|
197
197
|
directoryAsNamespace: false,
|
|
198
198
|
collapseSamePrefixes: false,
|
|
199
199
|
globalNamespaces: [],
|
|
200
|
+
transformerUserResolveFunctions: true,
|
|
200
201
|
resolvers: [],
|
|
201
202
|
globsExclude: [],
|
|
202
203
|
importPathTransform: (v) => v,
|
|
@@ -273,9 +274,12 @@ function resolveVue2(code, s) {
|
|
|
273
274
|
}
|
|
274
275
|
return results;
|
|
275
276
|
}
|
|
276
|
-
function resolveVue3(code, s) {
|
|
277
|
+
function resolveVue3(code, s, transformerUserResolveFunctions) {
|
|
277
278
|
const results = [];
|
|
278
|
-
for (const match of code.matchAll(/
|
|
279
|
+
for (const match of code.matchAll(/_?resolveComponent\d*\("(.+?)"\)/g)) {
|
|
280
|
+
if (!transformerUserResolveFunctions && !match[0].startsWith("_")) {
|
|
281
|
+
continue;
|
|
282
|
+
}
|
|
279
283
|
const matchedName = match[1];
|
|
280
284
|
if (match.index != null && matchedName && !matchedName.startsWith("_")) {
|
|
281
285
|
const start = match.index;
|
|
@@ -290,7 +294,7 @@ function resolveVue3(code, s) {
|
|
|
290
294
|
}
|
|
291
295
|
async function transformComponent(code, transformer2, s, ctx, sfcPath) {
|
|
292
296
|
let no = 0;
|
|
293
|
-
const results = transformer2 === "vue2" ? resolveVue2(code, s) : resolveVue3(code, s);
|
|
297
|
+
const results = transformer2 === "vue2" ? resolveVue2(code, s) : resolveVue3(code, s, ctx.options.transformerUserResolveFunctions);
|
|
294
298
|
for (const { rawName, replace } of results) {
|
|
295
299
|
debug2(`| ${rawName}`);
|
|
296
300
|
const name = _chunkCYD4VYHZcjs.pascalCase.call(void 0, rawName);
|
|
@@ -378,10 +382,13 @@ this.$options.directives["${name}"] = ${resolved};`);
|
|
|
378
382
|
}
|
|
379
383
|
|
|
380
384
|
// src/core/transforms/directive/vue3.ts
|
|
381
|
-
function resolveVue32(code, s) {
|
|
385
|
+
function resolveVue32(code, s, transformerUserResolveFunctions) {
|
|
382
386
|
const results = [];
|
|
383
|
-
for (const match of code.matchAll(/
|
|
387
|
+
for (const match of code.matchAll(/_?resolveDirective\("(.+?)"\)/g)) {
|
|
384
388
|
const matchedName = match[1];
|
|
389
|
+
if (!transformerUserResolveFunctions && !match[0].startsWith("_")) {
|
|
390
|
+
continue;
|
|
391
|
+
}
|
|
385
392
|
if (match.index != null && matchedName && !matchedName.startsWith("_")) {
|
|
386
393
|
const start = match.index;
|
|
387
394
|
const end = start + match[0].length;
|
|
@@ -197,6 +197,7 @@ var defaultOptions = {
|
|
|
197
197
|
directoryAsNamespace: false,
|
|
198
198
|
collapseSamePrefixes: false,
|
|
199
199
|
globalNamespaces: [],
|
|
200
|
+
transformerUserResolveFunctions: true,
|
|
200
201
|
resolvers: [],
|
|
201
202
|
globsExclude: [],
|
|
202
203
|
importPathTransform: (v) => v,
|
|
@@ -273,9 +274,12 @@ function resolveVue2(code, s) {
|
|
|
273
274
|
}
|
|
274
275
|
return results;
|
|
275
276
|
}
|
|
276
|
-
function resolveVue3(code, s) {
|
|
277
|
+
function resolveVue3(code, s, transformerUserResolveFunctions) {
|
|
277
278
|
const results = [];
|
|
278
|
-
for (const match of code.matchAll(/
|
|
279
|
+
for (const match of code.matchAll(/_?resolveComponent\d*\("(.+?)"\)/g)) {
|
|
280
|
+
if (!transformerUserResolveFunctions && !match[0].startsWith("_")) {
|
|
281
|
+
continue;
|
|
282
|
+
}
|
|
279
283
|
const matchedName = match[1];
|
|
280
284
|
if (match.index != null && matchedName && !matchedName.startsWith("_")) {
|
|
281
285
|
const start = match.index;
|
|
@@ -290,7 +294,7 @@ function resolveVue3(code, s) {
|
|
|
290
294
|
}
|
|
291
295
|
async function transformComponent(code, transformer2, s, ctx, sfcPath) {
|
|
292
296
|
let no = 0;
|
|
293
|
-
const results = transformer2 === "vue2" ? resolveVue2(code, s) : resolveVue3(code, s);
|
|
297
|
+
const results = transformer2 === "vue2" ? resolveVue2(code, s) : resolveVue3(code, s, ctx.options.transformerUserResolveFunctions);
|
|
294
298
|
for (const { rawName, replace } of results) {
|
|
295
299
|
debug2(`| ${rawName}`);
|
|
296
300
|
const name = pascalCase(rawName);
|
|
@@ -378,10 +382,13 @@ this.$options.directives["${name}"] = ${resolved};`);
|
|
|
378
382
|
}
|
|
379
383
|
|
|
380
384
|
// src/core/transforms/directive/vue3.ts
|
|
381
|
-
function resolveVue32(code, s) {
|
|
385
|
+
function resolveVue32(code, s, transformerUserResolveFunctions) {
|
|
382
386
|
const results = [];
|
|
383
|
-
for (const match of code.matchAll(/
|
|
387
|
+
for (const match of code.matchAll(/_?resolveDirective\("(.+?)"\)/g)) {
|
|
384
388
|
const matchedName = match[1];
|
|
389
|
+
if (!transformerUserResolveFunctions && !match[0].startsWith("_")) {
|
|
390
|
+
continue;
|
|
391
|
+
}
|
|
385
392
|
if (match.index != null && matchedName && !matchedName.startsWith("_")) {
|
|
386
393
|
const start = match.index;
|
|
387
394
|
const end = start + match[0].length;
|
package/dist/esbuild.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkQKHJKWZTcjs = require('./chunk-QKHJKWZT.cjs');
|
|
4
4
|
require('./chunk-CYD4VYHZ.cjs');
|
|
5
5
|
require('./chunk-3HT76LNN.cjs');
|
|
6
6
|
require('./chunk-ZBPRDZS4.cjs');
|
|
7
7
|
|
|
8
8
|
// src/esbuild.ts
|
|
9
|
-
var esbuild_default =
|
|
9
|
+
var esbuild_default = _chunkQKHJKWZTcjs.unplugin_default.esbuild;
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
exports.default = esbuild_default;
|
package/dist/esbuild.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkQKHJKWZTcjs = require('./chunk-QKHJKWZT.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -13,4 +13,4 @@ require('./chunk-ZBPRDZS4.cjs');
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
exports.camelCase = _chunkCYD4VYHZcjs.camelCase; exports.default =
|
|
16
|
+
exports.camelCase = _chunkCYD4VYHZcjs.camelCase; exports.default = _chunkQKHJKWZTcjs.unplugin_default; exports.kebabCase = _chunkCYD4VYHZcjs.kebabCase; exports.pascalCase = _chunkCYD4VYHZcjs.pascalCase;
|
package/dist/index.js
CHANGED
package/dist/nuxt.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkQKHJKWZTcjs = require('./chunk-QKHJKWZT.cjs');
|
|
4
4
|
require('./chunk-CYD4VYHZ.cjs');
|
|
5
5
|
require('./chunk-3HT76LNN.cjs');
|
|
6
6
|
require('./chunk-ZBPRDZS4.cjs');
|
|
@@ -9,8 +9,8 @@ require('./chunk-ZBPRDZS4.cjs');
|
|
|
9
9
|
var _kit = require('@nuxt/kit');
|
|
10
10
|
var nuxt_default = _kit.defineNuxtModule.call(void 0, {
|
|
11
11
|
setup(options) {
|
|
12
|
-
_kit.addWebpackPlugin.call(void 0,
|
|
13
|
-
_kit.addVitePlugin.call(void 0,
|
|
12
|
+
_kit.addWebpackPlugin.call(void 0, _chunkQKHJKWZTcjs.unplugin_default.webpack(options));
|
|
13
|
+
_kit.addVitePlugin.call(void 0, _chunkQKHJKWZTcjs.unplugin_default.vite(options));
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
|
package/dist/nuxt.js
CHANGED
package/dist/rollup.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkQKHJKWZTcjs = require('./chunk-QKHJKWZT.cjs');
|
|
4
4
|
require('./chunk-CYD4VYHZ.cjs');
|
|
5
5
|
require('./chunk-3HT76LNN.cjs');
|
|
6
6
|
require('./chunk-ZBPRDZS4.cjs');
|
|
7
7
|
|
|
8
8
|
// src/rollup.ts
|
|
9
|
-
var rollup_default =
|
|
9
|
+
var rollup_default = _chunkQKHJKWZTcjs.unplugin_default.rollup;
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
exports.default = rollup_default;
|
package/dist/rollup.js
CHANGED
package/dist/rspack.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkQKHJKWZTcjs = require('./chunk-QKHJKWZT.cjs');
|
|
4
4
|
require('./chunk-CYD4VYHZ.cjs');
|
|
5
5
|
require('./chunk-3HT76LNN.cjs');
|
|
6
6
|
require('./chunk-ZBPRDZS4.cjs');
|
|
7
7
|
|
|
8
8
|
// src/rspack.ts
|
|
9
|
-
var rspack_default =
|
|
9
|
+
var rspack_default = _chunkQKHJKWZTcjs.unplugin_default.rspack;
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
exports.default = rspack_default;
|
package/dist/rspack.js
CHANGED
package/dist/types.d.cts
CHANGED
|
@@ -125,6 +125,15 @@ interface Options {
|
|
|
125
125
|
* @default 'vue3'
|
|
126
126
|
*/
|
|
127
127
|
transformer?: SupportedTransformer;
|
|
128
|
+
/**
|
|
129
|
+
* Tranform users' usage of resolveComponent/resolveDirective as well
|
|
130
|
+
*
|
|
131
|
+
* If disabled, only components inside templates (which compiles to `_resolveComponent` etc.)
|
|
132
|
+
* will be transformed.
|
|
133
|
+
*
|
|
134
|
+
* @default true
|
|
135
|
+
*/
|
|
136
|
+
transformerUserResolveFunctions?: boolean;
|
|
128
137
|
/**
|
|
129
138
|
* Generate TypeScript declaration for global components
|
|
130
139
|
*
|
package/dist/types.d.ts
CHANGED
|
@@ -125,6 +125,15 @@ interface Options {
|
|
|
125
125
|
* @default 'vue3'
|
|
126
126
|
*/
|
|
127
127
|
transformer?: SupportedTransformer;
|
|
128
|
+
/**
|
|
129
|
+
* Tranform users' usage of resolveComponent/resolveDirective as well
|
|
130
|
+
*
|
|
131
|
+
* If disabled, only components inside templates (which compiles to `_resolveComponent` etc.)
|
|
132
|
+
* will be transformed.
|
|
133
|
+
*
|
|
134
|
+
* @default true
|
|
135
|
+
*/
|
|
136
|
+
transformerUserResolveFunctions?: boolean;
|
|
128
137
|
/**
|
|
129
138
|
* Generate TypeScript declaration for global components
|
|
130
139
|
*
|
package/dist/vite.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkQKHJKWZTcjs = require('./chunk-QKHJKWZT.cjs');
|
|
4
4
|
require('./chunk-CYD4VYHZ.cjs');
|
|
5
5
|
require('./chunk-3HT76LNN.cjs');
|
|
6
6
|
require('./chunk-ZBPRDZS4.cjs');
|
|
7
7
|
|
|
8
8
|
// src/vite.ts
|
|
9
|
-
var vite_default =
|
|
9
|
+
var vite_default = _chunkQKHJKWZTcjs.unplugin_default.vite;
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
exports.default = vite_default;
|
package/dist/vite.js
CHANGED
package/dist/webpack.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkQKHJKWZTcjs = require('./chunk-QKHJKWZT.cjs');
|
|
4
4
|
require('./chunk-CYD4VYHZ.cjs');
|
|
5
5
|
require('./chunk-3HT76LNN.cjs');
|
|
6
6
|
require('./chunk-ZBPRDZS4.cjs');
|
|
7
7
|
|
|
8
8
|
// src/webpack.ts
|
|
9
|
-
var webpack_default =
|
|
9
|
+
var webpack_default = _chunkQKHJKWZTcjs.unplugin_default.webpack;
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
exports.default = webpack_default;
|
package/dist/webpack.js
CHANGED
package/package.json
CHANGED