unplugin-vue-components 0.19.9 → 0.20.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 +1 -1
- package/dist/{chunk-MF6CXARB.js → chunk-46PS2JCI.js} +38 -34
- package/dist/{chunk-ZE7BF7UU.mjs → chunk-7NLFLZZX.mjs} +20 -16
- package/dist/chunk-BTQOTIPQ.js +32 -0
- package/dist/{chunk-EUNTLVSW.js → chunk-FD6BQCQ7.js} +2 -32
- package/dist/{chunk-W7GE2GWI.mjs → chunk-O6TSTZRE.mjs} +0 -30
- package/dist/chunk-ZKNUHGJ4.mjs +32 -0
- package/dist/esbuild.js +4 -3
- package/dist/esbuild.mjs +3 -2
- package/dist/index.js +4 -3
- package/dist/index.mjs +3 -2
- package/dist/nuxt.js +5 -4
- package/dist/nuxt.mjs +3 -2
- package/dist/resolvers.js +31 -23
- package/dist/resolvers.mjs +11 -3
- package/dist/rollup.js +4 -3
- package/dist/rollup.mjs +3 -2
- package/dist/src-4OAWGTJE.js +196 -0
- package/dist/src-WRIQ2NEL.mjs +195 -0
- package/dist/types.d.ts +1 -1
- package/dist/vite.js +4 -3
- package/dist/vite.mjs +3 -2
- package/dist/webpack.js +4 -3
- package/dist/webpack.mjs +3 -2
- package/package.json +21 -26
package/README.md
CHANGED
|
@@ -339,7 +339,7 @@ Components({
|
|
|
339
339
|
// auto import for directives
|
|
340
340
|
// default: `true` for Vue 3, `false` for Vue 2
|
|
341
341
|
// Babel is needed to do the transformation for Vue 2, it's disabled by default for performance concerns.
|
|
342
|
-
// To install Babel, run: `npm install -D @babel/parser
|
|
342
|
+
// To install Babel, run: `npm install -D @babel/parser`
|
|
343
343
|
directives: true,
|
|
344
344
|
|
|
345
345
|
// Transform path before resolving
|
|
@@ -9,10 +9,12 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
+
var _chunkFD6BQCQ7js = require('./chunk-FD6BQCQ7.js');
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
|
|
17
|
+
var _chunkBTQOTIPQjs = require('./chunk-BTQOTIPQ.js');
|
|
16
18
|
|
|
17
19
|
// src/core/unplugin.ts
|
|
18
20
|
var _unplugin = require('unplugin');
|
|
@@ -101,7 +103,7 @@ function resolveOptions(options, root) {
|
|
|
101
103
|
function getVueVersion() {
|
|
102
104
|
var _a;
|
|
103
105
|
try {
|
|
104
|
-
const vue =
|
|
106
|
+
const vue = _chunkBTQOTIPQjs.__require.call(void 0, "vue");
|
|
105
107
|
const version = ((_a = vue == null ? void 0 : vue.default) == null ? void 0 : _a.version) || (vue == null ? void 0 : vue.version) || "3";
|
|
106
108
|
return version.startsWith("2.") ? "vue2" : "vue3";
|
|
107
109
|
} catch (e2) {
|
|
@@ -140,13 +142,13 @@ function parseDeclaration(code) {
|
|
|
140
142
|
}
|
|
141
143
|
async function generateDeclaration(ctx, root, filepath, removeUnused = false) {
|
|
142
144
|
const items = [
|
|
143
|
-
...Object.values(
|
|
145
|
+
...Object.values(_chunkBTQOTIPQjs.__spreadValues.call(void 0, _chunkBTQOTIPQjs.__spreadValues.call(void 0, {}, ctx.componentNameMap), ctx.componentCustomMap)),
|
|
144
146
|
...resolveTypeImports(ctx.options.types)
|
|
145
147
|
];
|
|
146
148
|
const imports = Object.fromEntries(items.map(({ from: path, as: name, name: importName }) => {
|
|
147
149
|
if (!name)
|
|
148
150
|
return void 0;
|
|
149
|
-
path =
|
|
151
|
+
path = _chunkFD6BQCQ7js.getTransformedPath.call(void 0, path, ctx);
|
|
150
152
|
const related = _path.isAbsolute.call(void 0, path) ? `./${_path.relative.call(void 0, _path.dirname.call(void 0, filepath), path)}` : path;
|
|
151
153
|
let entry = `typeof import('${_utils.slash.call(void 0, related)}')`;
|
|
152
154
|
if (importName)
|
|
@@ -159,7 +161,7 @@ async function generateDeclaration(ctx, root, filepath, removeUnused = false) {
|
|
|
159
161
|
return;
|
|
160
162
|
const originalContent = _fs.existsSync.call(void 0, filepath) ? await _fs.promises.readFile(filepath, "utf-8") : "";
|
|
161
163
|
const originalImports = parseDeclaration(originalContent);
|
|
162
|
-
const lines = Object.entries(
|
|
164
|
+
const lines = Object.entries(_chunkBTQOTIPQjs.__spreadValues.call(void 0, _chunkBTQOTIPQjs.__spreadValues.call(void 0, {}, originalImports), imports)).sort((a, b) => a[0].localeCompare(b[0])).filter(([name]) => removeUnused ? items.find((i) => i.as === name) : true).map(([name, v]) => {
|
|
163
165
|
if (!/^\w+$/.test(name))
|
|
164
166
|
name = `'${name}'`;
|
|
165
167
|
return `${name}: ${v}`;
|
|
@@ -223,12 +225,12 @@ async function transformComponent(code, transformer2, s, ctx, sfcPath) {
|
|
|
223
225
|
const results = transformer2 === "vue2" ? resolveVue2(code, s) : resolveVue3(code, s);
|
|
224
226
|
for (const { rawName, replace } of results) {
|
|
225
227
|
debug2(`| ${rawName}`);
|
|
226
|
-
const name =
|
|
228
|
+
const name = _chunkFD6BQCQ7js.pascalCase.call(void 0, rawName);
|
|
227
229
|
ctx.updateUsageMap(sfcPath, [name]);
|
|
228
230
|
const component = await ctx.findComponent(name, "component", [sfcPath]);
|
|
229
231
|
if (component) {
|
|
230
232
|
const varName = `__unplugin_components_${no}`;
|
|
231
|
-
s.prepend(`${
|
|
233
|
+
s.prepend(`${_chunkFD6BQCQ7js.stringifyComponentImport.call(void 0, _chunkBTQOTIPQjs.__spreadProps.call(void 0, _chunkBTQOTIPQjs.__spreadValues.call(void 0, {}, component), { as: varName }), ctx)};
|
|
232
234
|
`);
|
|
233
235
|
no += 1;
|
|
234
236
|
replace(varName);
|
|
@@ -243,40 +245,42 @@ async function transformComponent(code, transformer2, s, ctx, sfcPath) {
|
|
|
243
245
|
// src/core/transforms/directive/vue2.ts
|
|
244
246
|
|
|
245
247
|
var getRenderFnStart = (ast) => {
|
|
248
|
+
var _a, _b;
|
|
246
249
|
const renderFn = ast.program.body.find((node) => node.type === "VariableDeclaration" && node.declarations[0].id.type === "Identifier" && node.declarations[0].id.name === "render");
|
|
247
|
-
const start = (renderFn == null ? void 0 : renderFn.declarations[0].init).body.start;
|
|
248
|
-
if (start === null)
|
|
250
|
+
const start = (_b = (_a = renderFn == null ? void 0 : renderFn.declarations[0].init) == null ? void 0 : _a.body) == null ? void 0 : _b.start;
|
|
251
|
+
if (start === null || start === void 0)
|
|
249
252
|
throw new Error("[unplugin-vue-components:directive] Cannot find render function position.");
|
|
250
253
|
return start + 1;
|
|
251
254
|
};
|
|
252
255
|
async function resolveVue22(code, s) {
|
|
253
|
-
var _a, _b;
|
|
254
|
-
if (!_localpkg.isPackageExists.call(void 0, "@babel/parser")
|
|
255
|
-
throw new Error('[unplugin-vue-components:directive] To use Vue 2 directive you will need to install Babel first: "npm install -D @babel/parser
|
|
256
|
+
var _a, _b, _c;
|
|
257
|
+
if (!_localpkg.isPackageExists.call(void 0, "@babel/parser"))
|
|
258
|
+
throw new Error('[unplugin-vue-components:directive] To use Vue 2 directive you will need to install Babel first: "npm install -D @babel/parser"');
|
|
256
259
|
const { parse } = await _localpkg.importModule.call(void 0, "@babel/parser");
|
|
257
260
|
const ast = parse(code, {
|
|
258
261
|
sourceType: "module"
|
|
259
262
|
});
|
|
260
263
|
const nodes = [];
|
|
261
|
-
const {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
264
|
+
const { walk } = await Promise.resolve().then(() => require("./src-4OAWGTJE.js"));
|
|
265
|
+
walk(ast.program, {
|
|
266
|
+
enter(node) {
|
|
267
|
+
if (node.type === "CallExpression")
|
|
268
|
+
nodes.push(node);
|
|
265
269
|
}
|
|
266
270
|
});
|
|
267
271
|
const results = [];
|
|
268
272
|
for (const node of nodes) {
|
|
269
273
|
const { callee, arguments: args } = node;
|
|
270
|
-
if (callee.type !== "Identifier" || callee.name !== "_c" || args[1] == null
|
|
274
|
+
if (callee.type !== "Identifier" || callee.name !== "_c" || ((_a = args[1]) == null ? void 0 : _a.type) !== "ObjectExpression")
|
|
271
275
|
continue;
|
|
272
|
-
const directives = (
|
|
276
|
+
const directives = (_b = args[1].properties.find((property) => property.type === "ObjectProperty" && property.key.type === "Identifier" && property.key.name === "directives")) == null ? void 0 : _b.value;
|
|
273
277
|
if (!directives || directives.type !== "ArrayExpression")
|
|
274
278
|
continue;
|
|
275
279
|
const renderStart = getRenderFnStart(ast);
|
|
276
280
|
for (const directive of directives.elements) {
|
|
277
281
|
if ((directive == null ? void 0 : directive.type) !== "ObjectExpression")
|
|
278
282
|
continue;
|
|
279
|
-
const nameNode = (
|
|
283
|
+
const nameNode = (_c = directive.properties.find((p) => p.type === "ObjectProperty" && p.key.type === "Identifier" && p.key.name === "name")) == null ? void 0 : _c.value;
|
|
280
284
|
if ((nameNode == null ? void 0 : nameNode.type) !== "StringLiteral")
|
|
281
285
|
continue;
|
|
282
286
|
const name = nameNode.value;
|
|
@@ -318,13 +322,13 @@ async function transformDirective(code, transformer2, s, ctx, sfcPath) {
|
|
|
318
322
|
const results = await (transformer2 === "vue2" ? resolveVue22(code, s) : resolveVue32(code, s));
|
|
319
323
|
for (const { rawName, replace } of results) {
|
|
320
324
|
debug3(`| ${rawName}`);
|
|
321
|
-
const name =
|
|
325
|
+
const name = _chunkFD6BQCQ7js.pascalCase.call(void 0, rawName);
|
|
322
326
|
ctx.updateUsageMap(sfcPath, [name]);
|
|
323
327
|
const directive = await ctx.findComponent(name, "directive", [sfcPath]);
|
|
324
328
|
if (!directive)
|
|
325
329
|
continue;
|
|
326
330
|
const varName = `__unplugin_directives_${no}`;
|
|
327
|
-
s.prepend(`${
|
|
331
|
+
s.prepend(`${_chunkFD6BQCQ7js.stringifyComponentImport.call(void 0, _chunkBTQOTIPQjs.__spreadProps.call(void 0, _chunkBTQOTIPQjs.__spreadValues.call(void 0, {}, directive), { as: varName }), ctx)};
|
|
328
332
|
`);
|
|
329
333
|
no += 1;
|
|
330
334
|
replace(varName);
|
|
@@ -343,7 +347,7 @@ function transformer(ctx, transformer2) {
|
|
|
343
347
|
await transformComponent(code, transformer2, s, ctx, sfcPath);
|
|
344
348
|
if (ctx.options.directives)
|
|
345
349
|
await transformDirective(code, transformer2, s, ctx, sfcPath);
|
|
346
|
-
s.prepend(
|
|
350
|
+
s.prepend(_chunkFD6BQCQ7js.DISABLE_COMMENT);
|
|
347
351
|
const result = { code: s.toString() };
|
|
348
352
|
if (ctx.sourcemap)
|
|
349
353
|
result.map = s.generateMap({ source: id, includeContent: true });
|
|
@@ -387,7 +391,7 @@ var Context = class {
|
|
|
387
391
|
this.transformer = transformer(this, name || "vue3");
|
|
388
392
|
}
|
|
389
393
|
transform(code, id) {
|
|
390
|
-
const { path, query } =
|
|
394
|
+
const { path, query } = _chunkFD6BQCQ7js.parseId.call(void 0, id);
|
|
391
395
|
return this.transformer(code, id, path, query);
|
|
392
396
|
}
|
|
393
397
|
setupViteServer(server) {
|
|
@@ -399,14 +403,14 @@ var Context = class {
|
|
|
399
403
|
setupWatcher(watcher) {
|
|
400
404
|
const { globs } = this.options;
|
|
401
405
|
watcher.on("unlink", (path) => {
|
|
402
|
-
if (!
|
|
406
|
+
if (!_chunkFD6BQCQ7js.matchGlobs.call(void 0, path, globs))
|
|
403
407
|
return;
|
|
404
408
|
path = _utils.slash.call(void 0, path);
|
|
405
409
|
this.removeComponents(path);
|
|
406
410
|
this.onUpdate(path);
|
|
407
411
|
});
|
|
408
412
|
watcher.on("add", (path) => {
|
|
409
|
-
if (!
|
|
413
|
+
if (!_chunkFD6BQCQ7js.matchGlobs.call(void 0, path, globs))
|
|
410
414
|
return;
|
|
411
415
|
path = _utils.slash.call(void 0, path);
|
|
412
416
|
this.addComponents(path);
|
|
@@ -416,14 +420,14 @@ var Context = class {
|
|
|
416
420
|
setupWatcherWebpack(watcher, emitUpdate) {
|
|
417
421
|
const { globs } = this.options;
|
|
418
422
|
watcher.on("unlink", (path) => {
|
|
419
|
-
if (!
|
|
423
|
+
if (!_chunkFD6BQCQ7js.matchGlobs.call(void 0, path, globs))
|
|
420
424
|
return;
|
|
421
425
|
path = _utils.slash.call(void 0, path);
|
|
422
426
|
this.removeComponents(path);
|
|
423
427
|
emitUpdate(path, "unlink");
|
|
424
428
|
});
|
|
425
429
|
watcher.on("add", (path) => {
|
|
426
|
-
if (!
|
|
430
|
+
if (!_chunkFD6BQCQ7js.matchGlobs.call(void 0, path, globs))
|
|
427
431
|
return;
|
|
428
432
|
path = _utils.slash.call(void 0, path);
|
|
429
433
|
this.addComponents(path);
|
|
@@ -470,7 +474,7 @@ var Context = class {
|
|
|
470
474
|
updates: []
|
|
471
475
|
};
|
|
472
476
|
const timestamp = +new Date();
|
|
473
|
-
const name =
|
|
477
|
+
const name = _chunkFD6BQCQ7js.pascalCase.call(void 0, _chunkFD6BQCQ7js.getNameFromFilePath.call(void 0, path, this.options));
|
|
474
478
|
Object.entries(this._componentUsageMap).forEach(([key, values]) => {
|
|
475
479
|
if (values.has(name)) {
|
|
476
480
|
const r = `/${_utils.slash.call(void 0, _path.relative.call(void 0, this.root, key))}`;
|
|
@@ -488,7 +492,7 @@ var Context = class {
|
|
|
488
492
|
updateComponentNameMap() {
|
|
489
493
|
this._componentNameMap = {};
|
|
490
494
|
Array.from(this._componentPaths).forEach((path) => {
|
|
491
|
-
const name =
|
|
495
|
+
const name = _chunkFD6BQCQ7js.pascalCase.call(void 0, _chunkFD6BQCQ7js.getNameFromFilePath.call(void 0, path, this.options));
|
|
492
496
|
if (this._componentNameMap[name] && !this.options.allowOverrides) {
|
|
493
497
|
console.warn(`[unplugin-vue-components] component "${name}"(${path}) has naming conflicts with other components, ignored.`);
|
|
494
498
|
return;
|
|
@@ -516,9 +520,9 @@ var Context = class {
|
|
|
516
520
|
this.addCustomComponents(info);
|
|
517
521
|
return info;
|
|
518
522
|
} else {
|
|
519
|
-
info =
|
|
523
|
+
info = _chunkBTQOTIPQjs.__spreadValues.call(void 0, {
|
|
520
524
|
as: name
|
|
521
|
-
},
|
|
525
|
+
}, _chunkFD6BQCQ7js.normalizeComponetInfo.call(void 0, result));
|
|
522
526
|
this.addCustomComponents(info);
|
|
523
527
|
return info;
|
|
524
528
|
}
|
|
@@ -528,7 +532,7 @@ var Context = class {
|
|
|
528
532
|
}
|
|
529
533
|
normalizePath(path) {
|
|
530
534
|
var _a, _b, _c;
|
|
531
|
-
return
|
|
535
|
+
return _chunkFD6BQCQ7js.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) || []);
|
|
532
536
|
}
|
|
533
537
|
relative(path) {
|
|
534
538
|
if (path.startsWith("/") && !path.startsWith(this.root))
|
|
@@ -565,7 +569,7 @@ var unplugin_default = _unplugin.createUnplugin.call(void 0, (options = {}) => {
|
|
|
565
569
|
return await ctx.findComponent(name, "component", filename ? [filename] : []);
|
|
566
570
|
},
|
|
567
571
|
stringifyImport(info) {
|
|
568
|
-
return
|
|
572
|
+
return _chunkFD6BQCQ7js.stringifyComponentImport.call(void 0, info, ctx);
|
|
569
573
|
}
|
|
570
574
|
};
|
|
571
575
|
return {
|
|
@@ -576,7 +580,7 @@ var unplugin_default = _unplugin.createUnplugin.call(void 0, (options = {}) => {
|
|
|
576
580
|
return filter(id);
|
|
577
581
|
},
|
|
578
582
|
async transform(code, id) {
|
|
579
|
-
if (!
|
|
583
|
+
if (!_chunkFD6BQCQ7js.shouldTransform.call(void 0, code))
|
|
580
584
|
return null;
|
|
581
585
|
try {
|
|
582
586
|
const result = await ctx.transform(code, id);
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DISABLE_COMMENT,
|
|
3
|
-
__require,
|
|
4
|
-
__spreadProps,
|
|
5
|
-
__spreadValues,
|
|
6
3
|
getNameFromFilePath,
|
|
7
4
|
getTransformedPath,
|
|
8
5
|
matchGlobs,
|
|
@@ -12,7 +9,12 @@ import {
|
|
|
12
9
|
resolveAlias,
|
|
13
10
|
shouldTransform,
|
|
14
11
|
stringifyComponentImport
|
|
15
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-O6TSTZRE.mjs";
|
|
13
|
+
import {
|
|
14
|
+
__require,
|
|
15
|
+
__spreadProps,
|
|
16
|
+
__spreadValues
|
|
17
|
+
} from "./chunk-ZKNUHGJ4.mjs";
|
|
16
18
|
|
|
17
19
|
// src/core/unplugin.ts
|
|
18
20
|
import { createUnplugin } from "unplugin";
|
|
@@ -243,40 +245,42 @@ import Debug3 from "debug";
|
|
|
243
245
|
// src/core/transforms/directive/vue2.ts
|
|
244
246
|
import { importModule, isPackageExists as isPackageExists3 } from "local-pkg";
|
|
245
247
|
var getRenderFnStart = (ast) => {
|
|
248
|
+
var _a, _b;
|
|
246
249
|
const renderFn = ast.program.body.find((node) => node.type === "VariableDeclaration" && node.declarations[0].id.type === "Identifier" && node.declarations[0].id.name === "render");
|
|
247
|
-
const start = (renderFn == null ? void 0 : renderFn.declarations[0].init).body.start;
|
|
248
|
-
if (start === null)
|
|
250
|
+
const start = (_b = (_a = renderFn == null ? void 0 : renderFn.declarations[0].init) == null ? void 0 : _a.body) == null ? void 0 : _b.start;
|
|
251
|
+
if (start === null || start === void 0)
|
|
249
252
|
throw new Error("[unplugin-vue-components:directive] Cannot find render function position.");
|
|
250
253
|
return start + 1;
|
|
251
254
|
};
|
|
252
255
|
async function resolveVue22(code, s) {
|
|
253
|
-
var _a, _b;
|
|
254
|
-
if (!isPackageExists3("@babel/parser")
|
|
255
|
-
throw new Error('[unplugin-vue-components:directive] To use Vue 2 directive you will need to install Babel first: "npm install -D @babel/parser
|
|
256
|
+
var _a, _b, _c;
|
|
257
|
+
if (!isPackageExists3("@babel/parser"))
|
|
258
|
+
throw new Error('[unplugin-vue-components:directive] To use Vue 2 directive you will need to install Babel first: "npm install -D @babel/parser"');
|
|
256
259
|
const { parse } = await importModule("@babel/parser");
|
|
257
260
|
const ast = parse(code, {
|
|
258
261
|
sourceType: "module"
|
|
259
262
|
});
|
|
260
263
|
const nodes = [];
|
|
261
|
-
const {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
264
|
+
const { walk } = await import("./src-WRIQ2NEL.mjs");
|
|
265
|
+
walk(ast.program, {
|
|
266
|
+
enter(node) {
|
|
267
|
+
if (node.type === "CallExpression")
|
|
268
|
+
nodes.push(node);
|
|
265
269
|
}
|
|
266
270
|
});
|
|
267
271
|
const results = [];
|
|
268
272
|
for (const node of nodes) {
|
|
269
273
|
const { callee, arguments: args } = node;
|
|
270
|
-
if (callee.type !== "Identifier" || callee.name !== "_c" || args[1] == null
|
|
274
|
+
if (callee.type !== "Identifier" || callee.name !== "_c" || ((_a = args[1]) == null ? void 0 : _a.type) !== "ObjectExpression")
|
|
271
275
|
continue;
|
|
272
|
-
const directives = (
|
|
276
|
+
const directives = (_b = args[1].properties.find((property) => property.type === "ObjectProperty" && property.key.type === "Identifier" && property.key.name === "directives")) == null ? void 0 : _b.value;
|
|
273
277
|
if (!directives || directives.type !== "ArrayExpression")
|
|
274
278
|
continue;
|
|
275
279
|
const renderStart = getRenderFnStart(ast);
|
|
276
280
|
for (const directive of directives.elements) {
|
|
277
281
|
if ((directive == null ? void 0 : directive.type) !== "ObjectExpression")
|
|
278
282
|
continue;
|
|
279
|
-
const nameNode = (
|
|
283
|
+
const nameNode = (_c = directive.properties.find((p) => p.type === "ObjectProperty" && p.key.type === "Identifier" && p.key.name === "name")) == null ? void 0 : _c.value;
|
|
280
284
|
if ((nameNode == null ? void 0 : nameNode.type) !== "StringLiteral")
|
|
281
285
|
continue;
|
|
282
286
|
const name = nameNode.value;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
21
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
22
|
+
}) : x)(function(x) {
|
|
23
|
+
if (typeof require !== "undefined")
|
|
24
|
+
return require.apply(this, arguments);
|
|
25
|
+
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
exports.__spreadValues = __spreadValues; exports.__spreadProps = __spreadProps; exports.__require = __require;
|
|
@@ -1,31 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
21
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
22
|
-
}) : x)(function(x) {
|
|
23
|
-
if (typeof require !== "undefined")
|
|
24
|
-
return require.apply(this, arguments);
|
|
25
|
-
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
// src/core/utils.ts
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }// src/core/utils.ts
|
|
29
2
|
var _path = require('path');
|
|
30
3
|
var _minimatch = require('minimatch'); var _minimatch2 = _interopRequireDefault(_minimatch);
|
|
31
4
|
var _resolve = require('resolve'); var _resolve2 = _interopRequireDefault(_resolve);
|
|
@@ -207,7 +180,4 @@ function resolveImportPath(importName) {
|
|
|
207
180
|
|
|
208
181
|
|
|
209
182
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
exports.__spreadValues = __spreadValues; exports.__spreadProps = __spreadProps; exports.__require = __require; 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.normalizeComponetInfo = normalizeComponetInfo; exports.stringifyComponentImport = stringifyComponentImport; exports.getNameFromFilePath = getNameFromFilePath; exports.resolveAlias = resolveAlias; exports.getPkgVersion = getPkgVersion; exports.shouldTransform = shouldTransform; exports.resolveImportPath = resolveImportPath;
|
|
183
|
+
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.normalizeComponetInfo = normalizeComponetInfo; exports.stringifyComponentImport = stringifyComponentImport; exports.getNameFromFilePath = getNameFromFilePath; exports.resolveAlias = resolveAlias; exports.getPkgVersion = getPkgVersion; exports.shouldTransform = shouldTransform; exports.resolveImportPath = resolveImportPath;
|
|
@@ -1,30 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
21
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
22
|
-
}) : x)(function(x) {
|
|
23
|
-
if (typeof require !== "undefined")
|
|
24
|
-
return require.apply(this, arguments);
|
|
25
|
-
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
26
|
-
});
|
|
27
|
-
|
|
28
1
|
// src/core/utils.ts
|
|
29
2
|
import { parse } from "path";
|
|
30
3
|
import minimatch from "minimatch";
|
|
@@ -192,9 +165,6 @@ function resolveImportPath(importName) {
|
|
|
192
165
|
}
|
|
193
166
|
|
|
194
167
|
export {
|
|
195
|
-
__spreadValues,
|
|
196
|
-
__spreadProps,
|
|
197
|
-
__require,
|
|
198
168
|
DISABLE_COMMENT,
|
|
199
169
|
isSSR,
|
|
200
170
|
pascalCase,
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
21
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
22
|
+
}) : x)(function(x) {
|
|
23
|
+
if (typeof require !== "undefined")
|
|
24
|
+
return require.apply(this, arguments);
|
|
25
|
+
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export {
|
|
29
|
+
__spreadValues,
|
|
30
|
+
__spreadProps,
|
|
31
|
+
__require
|
|
32
|
+
};
|
package/dist/esbuild.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var _chunk46PS2JCIjs = require('./chunk-46PS2JCI.js');
|
|
4
|
+
require('./chunk-FD6BQCQ7.js');
|
|
5
|
+
require('./chunk-BTQOTIPQ.js');
|
|
5
6
|
require('./chunk-6F4PWJZI.js');
|
|
6
7
|
|
|
7
8
|
// src/esbuild.ts
|
|
8
|
-
var esbuild_default =
|
|
9
|
+
var esbuild_default = _chunk46PS2JCIjs.unplugin_default.esbuild;
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
module.exports = esbuild_default;
|
package/dist/esbuild.mjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk46PS2JCIjs = require('./chunk-46PS2JCI.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkFD6BQCQ7js = require('./chunk-FD6BQCQ7.js');
|
|
9
|
+
require('./chunk-BTQOTIPQ.js');
|
|
9
10
|
require('./chunk-6F4PWJZI.js');
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
|
|
15
|
-
exports.camelCase =
|
|
16
|
+
exports.camelCase = _chunkFD6BQCQ7js.camelCase; exports.default = _chunk46PS2JCIjs.unplugin_default; exports.kebabCase = _chunkFD6BQCQ7js.kebabCase; exports.pascalCase = _chunkFD6BQCQ7js.pascalCase;
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
unplugin_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7NLFLZZX.mjs";
|
|
4
4
|
import {
|
|
5
5
|
camelCase,
|
|
6
6
|
kebabCase,
|
|
7
7
|
pascalCase
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-O6TSTZRE.mjs";
|
|
9
|
+
import "./chunk-ZKNUHGJ4.mjs";
|
|
9
10
|
import "./chunk-WBQAMGXK.mjs";
|
|
10
11
|
export {
|
|
11
12
|
camelCase,
|
package/dist/nuxt.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var _chunk46PS2JCIjs = require('./chunk-46PS2JCI.js');
|
|
4
|
+
require('./chunk-FD6BQCQ7.js');
|
|
5
|
+
require('./chunk-BTQOTIPQ.js');
|
|
5
6
|
require('./chunk-6F4PWJZI.js');
|
|
6
7
|
|
|
7
8
|
// src/nuxt.ts
|
|
8
9
|
function nuxt_default(options) {
|
|
9
10
|
this.extendBuild((config) => {
|
|
10
11
|
config.plugins = config.plugins || [];
|
|
11
|
-
config.plugins.unshift(
|
|
12
|
+
config.plugins.unshift(_chunk46PS2JCIjs.unplugin_default.webpack(options));
|
|
12
13
|
});
|
|
13
14
|
this.nuxt.hook("vite:extend", async (vite) => {
|
|
14
15
|
vite.config.plugins = vite.config.plugins || [];
|
|
15
|
-
vite.config.plugins.push(
|
|
16
|
+
vite.config.plugins.push(_chunk46PS2JCIjs.unplugin_default.vite(options));
|
|
16
17
|
});
|
|
17
18
|
}
|
|
18
19
|
|
package/dist/nuxt.mjs
CHANGED