@sepveneto/plugin-mp-router-view 0.3.3 → 0.3.5
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-673IL366.js → chunk-QNXQRN2I.js} +15 -9
- package/dist/esbuild.cjs +12 -11
- package/dist/esbuild.js +4 -3
- package/dist/index.cjs +18 -12
- package/dist/index.d.ts +5 -3
- package/dist/index.js +7 -3
- package/dist/{nuxt.cjs → loader.cjs} +43 -60
- package/dist/loader.d.ts +3 -0
- package/dist/loader.js +21 -0
- package/dist/rollup.cjs +12 -11
- package/dist/rollup.js +4 -3
- package/dist/type.d.cjs +1 -1
- package/dist/types.cjs +1 -1
- package/dist/vite.cjs +12 -11
- package/dist/vite.js +4 -3
- package/dist/webpack.cjs +47 -51
- package/dist/webpack.d.ts +2 -2
- package/dist/webpack.js +4 -9
- package/package.json +8 -3
- package/dist/nuxt.d.ts +0 -5
- package/dist/nuxt.js +0 -18
|
@@ -37041,19 +37041,19 @@ function countRouterView(code) {
|
|
|
37041
37041
|
return;
|
|
37042
37042
|
if (node2.children && node2.children.length > 0) {
|
|
37043
37043
|
node2.children.forEach((ele) => {
|
|
37044
|
-
traverse(ele);
|
|
37044
|
+
const res = traverse(ele);
|
|
37045
|
+
if (res) {
|
|
37046
|
+
const start = ele.loc.start.offset - node2.loc.start.offset;
|
|
37047
|
+
const end = ele.loc.end.offset - node2.loc.start.offset;
|
|
37048
|
+
before += node2.loc.source.substring(0, start);
|
|
37049
|
+
after += node2.loc.source.substring(end);
|
|
37050
|
+
}
|
|
37045
37051
|
});
|
|
37046
37052
|
return;
|
|
37047
37053
|
}
|
|
37048
37054
|
if (node2.tag === "router-view") {
|
|
37049
37055
|
++count;
|
|
37050
37056
|
return true;
|
|
37051
|
-
} else {
|
|
37052
|
-
if (count) {
|
|
37053
|
-
after += node2.loc.source;
|
|
37054
|
-
} else {
|
|
37055
|
-
before += node2.loc.source;
|
|
37056
|
-
}
|
|
37057
37057
|
}
|
|
37058
37058
|
}
|
|
37059
37059
|
traverse(ast);
|
|
@@ -37153,7 +37153,7 @@ function transform2(path4, code, entryPages, level) {
|
|
|
37153
37153
|
|
|
37154
37154
|
// src/index.ts
|
|
37155
37155
|
var NAME = "unplugin-mp-router-view";
|
|
37156
|
-
var
|
|
37156
|
+
var unpluginFactory = (options) => {
|
|
37157
37157
|
var _a, _b;
|
|
37158
37158
|
const log3 = (_a = options == null ? void 0 : options.log) != null ? _a : "error";
|
|
37159
37159
|
const entryPages = getPages((_b = options == null ? void 0 : options.collect) != null ? _b : true);
|
|
@@ -37169,12 +37169,18 @@ var src_default = createUnplugin((options) => {
|
|
|
37169
37169
|
return res;
|
|
37170
37170
|
}
|
|
37171
37171
|
};
|
|
37172
|
-
}
|
|
37172
|
+
};
|
|
37173
|
+
var unplugin = /* @__PURE__ */ createUnplugin(unpluginFactory);
|
|
37174
|
+
var src_default = unplugin;
|
|
37173
37175
|
|
|
37174
37176
|
export {
|
|
37177
|
+
isAppVue,
|
|
37178
|
+
isEntryPage,
|
|
37175
37179
|
getPages,
|
|
37176
37180
|
transform2 as transform,
|
|
37177
37181
|
NAME,
|
|
37182
|
+
unpluginFactory,
|
|
37183
|
+
unplugin,
|
|
37178
37184
|
src_default
|
|
37179
37185
|
};
|
|
37180
37186
|
/*!
|
package/dist/esbuild.cjs
CHANGED
|
@@ -58,6 +58,7 @@ __export(esbuild_exports, {
|
|
|
58
58
|
default: () => esbuild_default
|
|
59
59
|
});
|
|
60
60
|
module.exports = __toCommonJS(esbuild_exports);
|
|
61
|
+
var import_unplugin2 = require("unplugin");
|
|
61
62
|
|
|
62
63
|
// src/index.ts
|
|
63
64
|
var import_node_path2 = __toESM(require("path"), 1);
|
|
@@ -37070,19 +37071,19 @@ function countRouterView(code) {
|
|
|
37070
37071
|
return;
|
|
37071
37072
|
if (node2.children && node2.children.length > 0) {
|
|
37072
37073
|
node2.children.forEach((ele) => {
|
|
37073
|
-
traverse(ele);
|
|
37074
|
+
const res = traverse(ele);
|
|
37075
|
+
if (res) {
|
|
37076
|
+
const start = ele.loc.start.offset - node2.loc.start.offset;
|
|
37077
|
+
const end = ele.loc.end.offset - node2.loc.start.offset;
|
|
37078
|
+
before += node2.loc.source.substring(0, start);
|
|
37079
|
+
after += node2.loc.source.substring(end);
|
|
37080
|
+
}
|
|
37074
37081
|
});
|
|
37075
37082
|
return;
|
|
37076
37083
|
}
|
|
37077
37084
|
if (node2.tag === "router-view") {
|
|
37078
37085
|
++count;
|
|
37079
37086
|
return true;
|
|
37080
|
-
} else {
|
|
37081
|
-
if (count) {
|
|
37082
|
-
after += node2.loc.source;
|
|
37083
|
-
} else {
|
|
37084
|
-
before += node2.loc.source;
|
|
37085
|
-
}
|
|
37086
37087
|
}
|
|
37087
37088
|
}
|
|
37088
37089
|
traverse(ast);
|
|
@@ -37182,7 +37183,7 @@ function transform2(path4, code, entryPages, level) {
|
|
|
37182
37183
|
|
|
37183
37184
|
// src/index.ts
|
|
37184
37185
|
var NAME = "unplugin-mp-router-view";
|
|
37185
|
-
var
|
|
37186
|
+
var unpluginFactory = (options) => {
|
|
37186
37187
|
var _a, _b;
|
|
37187
37188
|
const log3 = (_a = options == null ? void 0 : options.log) != null ? _a : "error";
|
|
37188
37189
|
const entryPages = getPages((_b = options == null ? void 0 : options.collect) != null ? _b : true);
|
|
@@ -37198,10 +37199,10 @@ var src_default = (0, import_unplugin.createUnplugin)((options) => {
|
|
|
37198
37199
|
return res;
|
|
37199
37200
|
}
|
|
37200
37201
|
};
|
|
37201
|
-
}
|
|
37202
|
+
};
|
|
37202
37203
|
|
|
37203
37204
|
// src/esbuild.ts
|
|
37204
|
-
var esbuild_default =
|
|
37205
|
+
var esbuild_default = (0, import_unplugin2.createEsbuildPlugin)(unpluginFactory);
|
|
37205
37206
|
// Annotate the CommonJS export names for ESM import in node:
|
|
37206
37207
|
0 && (module.exports = {});
|
|
37207
37208
|
/*!
|
|
@@ -37212,4 +37213,4 @@ var esbuild_default = src_default.esbuild;
|
|
|
37212
37213
|
*/
|
|
37213
37214
|
/*! https://mths.be/cssesc v3.0.0 by @mathias */
|
|
37214
37215
|
/*! https://mths.be/punycode v1.4.1 by @mathias */
|
|
37215
|
-
exports.default = module.exports;
|
|
37216
|
+
if (module.exports.default) module.exports = module.exports.default;
|
package/dist/esbuild.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
unpluginFactory
|
|
3
|
+
} from "./chunk-QNXQRN2I.js";
|
|
4
4
|
|
|
5
5
|
// src/esbuild.ts
|
|
6
|
-
|
|
6
|
+
import { createEsbuildPlugin } from "unplugin";
|
|
7
|
+
var esbuild_default = createEsbuildPlugin(unpluginFactory);
|
|
7
8
|
export {
|
|
8
9
|
esbuild_default as default
|
|
9
10
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -56,7 +56,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
56
56
|
var src_exports = {};
|
|
57
57
|
__export(src_exports, {
|
|
58
58
|
NAME: () => NAME,
|
|
59
|
-
default: () => src_default
|
|
59
|
+
default: () => src_default,
|
|
60
|
+
unplugin: () => unplugin,
|
|
61
|
+
unpluginFactory: () => unpluginFactory
|
|
60
62
|
});
|
|
61
63
|
module.exports = __toCommonJS(src_exports);
|
|
62
64
|
var import_node_path2 = __toESM(require("path"), 1);
|
|
@@ -37069,19 +37071,19 @@ function countRouterView(code) {
|
|
|
37069
37071
|
return;
|
|
37070
37072
|
if (node2.children && node2.children.length > 0) {
|
|
37071
37073
|
node2.children.forEach((ele) => {
|
|
37072
|
-
traverse(ele);
|
|
37074
|
+
const res = traverse(ele);
|
|
37075
|
+
if (res) {
|
|
37076
|
+
const start = ele.loc.start.offset - node2.loc.start.offset;
|
|
37077
|
+
const end = ele.loc.end.offset - node2.loc.start.offset;
|
|
37078
|
+
before += node2.loc.source.substring(0, start);
|
|
37079
|
+
after += node2.loc.source.substring(end);
|
|
37080
|
+
}
|
|
37073
37081
|
});
|
|
37074
37082
|
return;
|
|
37075
37083
|
}
|
|
37076
37084
|
if (node2.tag === "router-view") {
|
|
37077
37085
|
++count;
|
|
37078
37086
|
return true;
|
|
37079
|
-
} else {
|
|
37080
|
-
if (count) {
|
|
37081
|
-
after += node2.loc.source;
|
|
37082
|
-
} else {
|
|
37083
|
-
before += node2.loc.source;
|
|
37084
|
-
}
|
|
37085
37087
|
}
|
|
37086
37088
|
}
|
|
37087
37089
|
traverse(ast);
|
|
@@ -37181,7 +37183,7 @@ function transform2(path4, code, entryPages, level) {
|
|
|
37181
37183
|
|
|
37182
37184
|
// src/index.ts
|
|
37183
37185
|
var NAME = "unplugin-mp-router-view";
|
|
37184
|
-
var
|
|
37186
|
+
var unpluginFactory = (options) => {
|
|
37185
37187
|
var _a, _b;
|
|
37186
37188
|
const log3 = (_a = options == null ? void 0 : options.log) != null ? _a : "error";
|
|
37187
37189
|
const entryPages = getPages((_b = options == null ? void 0 : options.collect) != null ? _b : true);
|
|
@@ -37197,10 +37199,14 @@ var src_default = (0, import_unplugin.createUnplugin)((options) => {
|
|
|
37197
37199
|
return res;
|
|
37198
37200
|
}
|
|
37199
37201
|
};
|
|
37200
|
-
}
|
|
37202
|
+
};
|
|
37203
|
+
var unplugin = /* @__PURE__ */ (0, import_unplugin.createUnplugin)(unpluginFactory);
|
|
37204
|
+
var src_default = unplugin;
|
|
37201
37205
|
// Annotate the CommonJS export names for ESM import in node:
|
|
37202
37206
|
0 && (module.exports = {
|
|
37203
|
-
NAME
|
|
37207
|
+
NAME,
|
|
37208
|
+
unplugin,
|
|
37209
|
+
unpluginFactory
|
|
37204
37210
|
});
|
|
37205
37211
|
/*!
|
|
37206
37212
|
* The buffer module from node.js, for the browser.
|
|
@@ -37210,4 +37216,4 @@ var src_default = (0, import_unplugin.createUnplugin)((options) => {
|
|
|
37210
37216
|
*/
|
|
37211
37217
|
/*! https://mths.be/cssesc v3.0.0 by @mathias */
|
|
37212
37218
|
/*! https://mths.be/punycode v1.4.1 by @mathias */
|
|
37213
|
-
exports.default = module.exports;
|
|
37219
|
+
if (module.exports.default) module.exports = module.exports.default;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _unplugin from 'unplugin';
|
|
2
|
+
import { UnpluginFactory } from 'unplugin';
|
|
2
3
|
import { Options } from './types.js';
|
|
3
4
|
|
|
4
5
|
declare const NAME = "unplugin-mp-router-view";
|
|
5
|
-
declare const
|
|
6
|
+
declare const unpluginFactory: UnpluginFactory<Options | undefined>;
|
|
7
|
+
declare const unplugin: _unplugin.UnpluginInstance<Options | undefined, boolean>;
|
|
6
8
|
|
|
7
|
-
export { NAME,
|
|
9
|
+
export { NAME, unplugin as default, unplugin, unpluginFactory };
|
package/dist/index.js
CHANGED
|
@@ -52,24 +52,27 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
52
52
|
));
|
|
53
53
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
54
54
|
|
|
55
|
-
// src/
|
|
56
|
-
var
|
|
57
|
-
__export(
|
|
58
|
-
default: () =>
|
|
55
|
+
// src/loader.ts
|
|
56
|
+
var loader_exports = {};
|
|
57
|
+
__export(loader_exports, {
|
|
58
|
+
default: () => loader_default
|
|
59
59
|
});
|
|
60
|
-
module.exports = __toCommonJS(
|
|
61
|
-
|
|
62
|
-
// src/index.ts
|
|
63
|
-
var import_node_path2 = __toESM(require("path"), 1);
|
|
64
|
-
var import_unplugin = require("unplugin");
|
|
60
|
+
module.exports = __toCommonJS(loader_exports);
|
|
65
61
|
|
|
66
62
|
// src/util/parse.ts
|
|
67
63
|
var import_node_fs = __toESM(require("fs"), 1);
|
|
68
|
-
var
|
|
64
|
+
var import_node_path2 = __toESM(require("path"), 1);
|
|
69
65
|
var import_jsonc_parser = require("jsonc-parser");
|
|
70
66
|
|
|
71
67
|
// src/util/error.ts
|
|
72
68
|
var import_colors = __toESM(require("colors"), 1);
|
|
69
|
+
|
|
70
|
+
// src/index.ts
|
|
71
|
+
var import_node_path = __toESM(require("path"), 1);
|
|
72
|
+
var import_unplugin = require("unplugin");
|
|
73
|
+
var NAME = "unplugin-mp-router-view";
|
|
74
|
+
|
|
75
|
+
// src/util/error.ts
|
|
73
76
|
function genError(msg) {
|
|
74
77
|
return `${import_colors.default.yellow(`
|
|
75
78
|
[${NAME}]`)} ${import_colors.default.red(`\u2716 ${msg}`)}`;
|
|
@@ -14614,7 +14617,7 @@ function createTransformContext(root2, { filename = "", prefixIdentifiers = fals
|
|
|
14614
14617
|
}
|
|
14615
14618
|
return context;
|
|
14616
14619
|
}
|
|
14617
|
-
function
|
|
14620
|
+
function transform2(root2, options) {
|
|
14618
14621
|
const context = createTransformContext(root2, options);
|
|
14619
14622
|
traverseNode(root2, context);
|
|
14620
14623
|
if (options.hoistStatic) {
|
|
@@ -19070,7 +19073,7 @@ function baseCompile(template, options = {}) {
|
|
|
19070
19073
|
options.expressionPlugins = [...expressionPlugins || [], "typescript"];
|
|
19071
19074
|
}
|
|
19072
19075
|
}
|
|
19073
|
-
|
|
19076
|
+
transform2(ast, extend({}, options, {
|
|
19074
19077
|
prefixIdentifiers,
|
|
19075
19078
|
nodeTransforms: [
|
|
19076
19079
|
...nodeTransforms,
|
|
@@ -22009,7 +22012,7 @@ var CompilerDOM = /* @__PURE__ */ Object.freeze({
|
|
|
22009
22012
|
TRANSITION_GROUP,
|
|
22010
22013
|
baseCompile,
|
|
22011
22014
|
baseParse,
|
|
22012
|
-
transform,
|
|
22015
|
+
transform: transform2,
|
|
22013
22016
|
createTransformContext,
|
|
22014
22017
|
traverseNode,
|
|
22015
22018
|
createStructuralDirectiveTransform,
|
|
@@ -24956,7 +24959,7 @@ function basename(path4, ext) {
|
|
|
24956
24959
|
function extname(path4) {
|
|
24957
24960
|
return splitPath(path4)[3];
|
|
24958
24961
|
}
|
|
24959
|
-
var
|
|
24962
|
+
var path2 = {
|
|
24960
24963
|
extname,
|
|
24961
24964
|
basename,
|
|
24962
24965
|
dirname,
|
|
@@ -24997,7 +25000,7 @@ var _polyfillNode_path = /* @__PURE__ */ Object.freeze({
|
|
|
24997
25000
|
dirname,
|
|
24998
25001
|
basename,
|
|
24999
25002
|
extname,
|
|
25000
|
-
"default":
|
|
25003
|
+
"default": path2
|
|
25001
25004
|
});
|
|
25002
25005
|
var maxInt = 2147483647;
|
|
25003
25006
|
var base = 36;
|
|
@@ -26494,7 +26497,7 @@ var transformAssetUrl = (node2, context, options = defaultAssetUrlOptions) => {
|
|
|
26494
26497
|
const protocol = base2.protocol || "";
|
|
26495
26498
|
const host = base2.host ? protocol + "//" + base2.host : "";
|
|
26496
26499
|
const basePath = base2.path || "/";
|
|
26497
|
-
attr.value.content = host + (
|
|
26500
|
+
attr.value.content = host + (path2.posix || path2).join(basePath, url.path + (url.hash || ""));
|
|
26498
26501
|
return;
|
|
26499
26502
|
}
|
|
26500
26503
|
const exp = getImportsExpressionExp(url.path, url.hash, attr.loc, context);
|
|
@@ -26581,7 +26584,7 @@ var transformSrcset = (node2, context, options = defaultAssetUrlOptions) => {
|
|
|
26581
26584
|
let { url, descriptor } = candidate;
|
|
26582
26585
|
descriptor = descriptor ? ` ${descriptor}` : ``;
|
|
26583
26586
|
if (url[0] === ".") {
|
|
26584
|
-
candidate.url = (
|
|
26587
|
+
candidate.url = (path2.posix || path2).join(base2, url);
|
|
26585
26588
|
set.push(candidate.url + descriptor);
|
|
26586
26589
|
} else if (shouldProcessUrl(url)) {
|
|
26587
26590
|
needImportTransform = true;
|
|
@@ -27597,7 +27600,7 @@ function compile$1(template, options = {}) {
|
|
|
27597
27600
|
});
|
|
27598
27601
|
const ast = baseParse(template, options);
|
|
27599
27602
|
rawOptionsMap.set(ast, options);
|
|
27600
|
-
|
|
27603
|
+
transform2(ast, Object.assign(Object.assign({}, options), { hoistStatic: false, nodeTransforms: [
|
|
27601
27604
|
ssrTransformIf,
|
|
27602
27605
|
ssrTransformFor,
|
|
27603
27606
|
trackVForSlotScopes,
|
|
@@ -27803,7 +27806,7 @@ function resolveTemplateUsageCheckString(sfc) {
|
|
|
27803
27806
|
return cached;
|
|
27804
27807
|
}
|
|
27805
27808
|
let code = "";
|
|
27806
|
-
|
|
27809
|
+
transform2(createRoot([ast]), {
|
|
27807
27810
|
nodeTransforms: [
|
|
27808
27811
|
(node2) => {
|
|
27809
27812
|
if (node2.type === 1) {
|
|
@@ -37070,19 +37073,19 @@ function countRouterView(code) {
|
|
|
37070
37073
|
return;
|
|
37071
37074
|
if (node2.children && node2.children.length > 0) {
|
|
37072
37075
|
node2.children.forEach((ele) => {
|
|
37073
|
-
traverse(ele);
|
|
37076
|
+
const res = traverse(ele);
|
|
37077
|
+
if (res) {
|
|
37078
|
+
const start = ele.loc.start.offset - node2.loc.start.offset;
|
|
37079
|
+
const end = ele.loc.end.offset - node2.loc.start.offset;
|
|
37080
|
+
before += node2.loc.source.substring(0, start);
|
|
37081
|
+
after += node2.loc.source.substring(end);
|
|
37082
|
+
}
|
|
37074
37083
|
});
|
|
37075
37084
|
return;
|
|
37076
37085
|
}
|
|
37077
37086
|
if (node2.tag === "router-view") {
|
|
37078
37087
|
++count;
|
|
37079
37088
|
return true;
|
|
37080
|
-
} else {
|
|
37081
|
-
if (count) {
|
|
37082
|
-
after += node2.loc.source;
|
|
37083
|
-
} else {
|
|
37084
|
-
before += node2.loc.source;
|
|
37085
|
-
}
|
|
37086
37089
|
}
|
|
37087
37090
|
}
|
|
37088
37091
|
traverse(ast);
|
|
@@ -37123,7 +37126,7 @@ function addToFooter(code, footer2) {
|
|
|
37123
37126
|
return code.replace(/(<\/view>)(\s*)(<\/template>)(?!(([\s\S]*)(<\/template>)))/, (p) => footer2 + p);
|
|
37124
37127
|
}
|
|
37125
37128
|
function getPages(collectMode) {
|
|
37126
|
-
const jsonStr = import_node_fs.default.readFileSync(
|
|
37129
|
+
const jsonStr = import_node_fs.default.readFileSync(import_node_path2.default.resolve(INPUT_DIR, "pages.json"), "utf-8");
|
|
37127
37130
|
const pagesJson = parseJson(jsonStr);
|
|
37128
37131
|
const { pages, subPackages = [] } = pagesJson;
|
|
37129
37132
|
const entryList = [...collectEntry(collectMode, pages), ...collectEntry(collectMode, subPackages)];
|
|
@@ -37139,7 +37142,7 @@ function collectEntry(collectMode, json, root2 = "") {
|
|
|
37139
37142
|
if (!collectMode) {
|
|
37140
37143
|
return;
|
|
37141
37144
|
}
|
|
37142
|
-
const _path2 =
|
|
37145
|
+
const _path2 = import_node_path2.default.resolve(INPUT_DIR, `${root2}${root2 ? "/" : ""}${item.path}`);
|
|
37143
37146
|
if (collectMode && typeof collectMode === "boolean" && !item["ROUTER_VIEW_EXCLUDE"]) {
|
|
37144
37147
|
entryList.push(_path2);
|
|
37145
37148
|
} else if (typeof collectMode === "string" && item[collectMode]) {
|
|
@@ -37159,7 +37162,7 @@ function combineCode(code, header2, footer2) {
|
|
|
37159
37162
|
code = addToFooter(code, footer2);
|
|
37160
37163
|
return code;
|
|
37161
37164
|
}
|
|
37162
|
-
function
|
|
37165
|
+
function transform(path4, code, entryPages, level) {
|
|
37163
37166
|
logLevel = level;
|
|
37164
37167
|
if (isAppVue(path4)) {
|
|
37165
37168
|
log(`\u57FA\u4E8E\u5E73\u53F0${process.env.UNI_PLATFORM}, \u5904\u7406App.vue...`, logLevel);
|
|
@@ -37180,36 +37183,16 @@ function transform2(path4, code, entryPages, level) {
|
|
|
37180
37183
|
return code;
|
|
37181
37184
|
}
|
|
37182
37185
|
|
|
37183
|
-
// src/
|
|
37184
|
-
|
|
37185
|
-
|
|
37186
|
-
|
|
37187
|
-
const
|
|
37188
|
-
const
|
|
37189
|
-
|
|
37190
|
-
|
|
37191
|
-
|
|
37192
|
-
|
|
37193
|
-
const _id = import_node_path2.default.resolve(id2);
|
|
37194
|
-
return isAppVue(_id) || isEntryPage(_id, entryPages);
|
|
37195
|
-
},
|
|
37196
|
-
transform(code, id2) {
|
|
37197
|
-
const res = transform2(import_node_path2.default.resolve(id2), code, entryPages, log3);
|
|
37198
|
-
return res;
|
|
37199
|
-
}
|
|
37200
|
-
};
|
|
37201
|
-
});
|
|
37202
|
-
|
|
37203
|
-
// src/nuxt.ts
|
|
37204
|
-
function nuxt_default(options = {}, nuxt) {
|
|
37205
|
-
nuxt.hook("webpack:config", async (config2) => {
|
|
37206
|
-
config2.plugins = config2.plugins || [];
|
|
37207
|
-
config2.plugins.unshift(src_default.webpack(options));
|
|
37208
|
-
});
|
|
37209
|
-
nuxt.hook("vite:extendConfig", async (config2) => {
|
|
37210
|
-
config2.plugins = config2.plugins || [];
|
|
37211
|
-
config2.plugins.push(src_default.vite(options));
|
|
37212
|
-
});
|
|
37186
|
+
// src/loader.ts
|
|
37187
|
+
function loader_default(source) {
|
|
37188
|
+
const { log: logConfig, collect } = this.query || {};
|
|
37189
|
+
const log3 = logConfig || "error";
|
|
37190
|
+
const entryPages = getPages(collect != null ? collect : true);
|
|
37191
|
+
const path4 = this.resourcePath;
|
|
37192
|
+
if (isAppVue(path4) || isEntryPage(path4, entryPages)) {
|
|
37193
|
+
source = transform(path4, source, entryPages, log3);
|
|
37194
|
+
}
|
|
37195
|
+
return source;
|
|
37213
37196
|
}
|
|
37214
37197
|
// Annotate the CommonJS export names for ESM import in node:
|
|
37215
37198
|
0 && (module.exports = {});
|
|
@@ -37221,4 +37204,4 @@ function nuxt_default(options = {}, nuxt) {
|
|
|
37221
37204
|
*/
|
|
37222
37205
|
/*! https://mths.be/cssesc v3.0.0 by @mathias */
|
|
37223
37206
|
/*! https://mths.be/punycode v1.4.1 by @mathias */
|
|
37224
|
-
exports.default = module.exports;
|
|
37207
|
+
if (module.exports.default) module.exports = module.exports.default;
|
package/dist/loader.d.ts
ADDED
package/dist/loader.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getPages,
|
|
3
|
+
isAppVue,
|
|
4
|
+
isEntryPage,
|
|
5
|
+
transform
|
|
6
|
+
} from "./chunk-QNXQRN2I.js";
|
|
7
|
+
|
|
8
|
+
// src/loader.ts
|
|
9
|
+
function loader_default(source) {
|
|
10
|
+
const { log: logConfig, collect } = this.query || {};
|
|
11
|
+
const log = logConfig || "error";
|
|
12
|
+
const entryPages = getPages(collect != null ? collect : true);
|
|
13
|
+
const path = this.resourcePath;
|
|
14
|
+
if (isAppVue(path) || isEntryPage(path, entryPages)) {
|
|
15
|
+
source = transform(path, source, entryPages, log);
|
|
16
|
+
}
|
|
17
|
+
return source;
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
loader_default as default
|
|
21
|
+
};
|
package/dist/rollup.cjs
CHANGED
|
@@ -58,6 +58,7 @@ __export(rollup_exports, {
|
|
|
58
58
|
default: () => rollup_default
|
|
59
59
|
});
|
|
60
60
|
module.exports = __toCommonJS(rollup_exports);
|
|
61
|
+
var import_unplugin2 = require("unplugin");
|
|
61
62
|
|
|
62
63
|
// src/index.ts
|
|
63
64
|
var import_node_path2 = __toESM(require("path"), 1);
|
|
@@ -37070,19 +37071,19 @@ function countRouterView(code) {
|
|
|
37070
37071
|
return;
|
|
37071
37072
|
if (node2.children && node2.children.length > 0) {
|
|
37072
37073
|
node2.children.forEach((ele) => {
|
|
37073
|
-
traverse(ele);
|
|
37074
|
+
const res = traverse(ele);
|
|
37075
|
+
if (res) {
|
|
37076
|
+
const start = ele.loc.start.offset - node2.loc.start.offset;
|
|
37077
|
+
const end = ele.loc.end.offset - node2.loc.start.offset;
|
|
37078
|
+
before += node2.loc.source.substring(0, start);
|
|
37079
|
+
after += node2.loc.source.substring(end);
|
|
37080
|
+
}
|
|
37074
37081
|
});
|
|
37075
37082
|
return;
|
|
37076
37083
|
}
|
|
37077
37084
|
if (node2.tag === "router-view") {
|
|
37078
37085
|
++count;
|
|
37079
37086
|
return true;
|
|
37080
|
-
} else {
|
|
37081
|
-
if (count) {
|
|
37082
|
-
after += node2.loc.source;
|
|
37083
|
-
} else {
|
|
37084
|
-
before += node2.loc.source;
|
|
37085
|
-
}
|
|
37086
37087
|
}
|
|
37087
37088
|
}
|
|
37088
37089
|
traverse(ast);
|
|
@@ -37182,7 +37183,7 @@ function transform2(path4, code, entryPages, level) {
|
|
|
37182
37183
|
|
|
37183
37184
|
// src/index.ts
|
|
37184
37185
|
var NAME = "unplugin-mp-router-view";
|
|
37185
|
-
var
|
|
37186
|
+
var unpluginFactory = (options) => {
|
|
37186
37187
|
var _a, _b;
|
|
37187
37188
|
const log3 = (_a = options == null ? void 0 : options.log) != null ? _a : "error";
|
|
37188
37189
|
const entryPages = getPages((_b = options == null ? void 0 : options.collect) != null ? _b : true);
|
|
@@ -37198,10 +37199,10 @@ var src_default = (0, import_unplugin.createUnplugin)((options) => {
|
|
|
37198
37199
|
return res;
|
|
37199
37200
|
}
|
|
37200
37201
|
};
|
|
37201
|
-
}
|
|
37202
|
+
};
|
|
37202
37203
|
|
|
37203
37204
|
// src/rollup.ts
|
|
37204
|
-
var rollup_default =
|
|
37205
|
+
var rollup_default = (0, import_unplugin2.createRollupPlugin)(unpluginFactory);
|
|
37205
37206
|
// Annotate the CommonJS export names for ESM import in node:
|
|
37206
37207
|
0 && (module.exports = {});
|
|
37207
37208
|
/*!
|
|
@@ -37212,4 +37213,4 @@ var rollup_default = src_default.rollup;
|
|
|
37212
37213
|
*/
|
|
37213
37214
|
/*! https://mths.be/cssesc v3.0.0 by @mathias */
|
|
37214
37215
|
/*! https://mths.be/punycode v1.4.1 by @mathias */
|
|
37215
|
-
exports.default = module.exports;
|
|
37216
|
+
if (module.exports.default) module.exports = module.exports.default;
|
package/dist/rollup.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
unpluginFactory
|
|
3
|
+
} from "./chunk-QNXQRN2I.js";
|
|
4
4
|
|
|
5
5
|
// src/rollup.ts
|
|
6
|
-
|
|
6
|
+
import { createRollupPlugin } from "unplugin";
|
|
7
|
+
var rollup_default = createRollupPlugin(unpluginFactory);
|
|
7
8
|
export {
|
|
8
9
|
rollup_default as default
|
|
9
10
|
};
|
package/dist/type.d.cjs
CHANGED
|
@@ -16,4 +16,4 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
16
16
|
// src/type.d.ts
|
|
17
17
|
var type_d_exports = {};
|
|
18
18
|
module.exports = __toCommonJS(type_d_exports);
|
|
19
|
-
exports.default = module.exports;
|
|
19
|
+
if (module.exports.default) module.exports = module.exports.default;
|
package/dist/types.cjs
CHANGED
|
@@ -16,4 +16,4 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
16
16
|
// src/types.ts
|
|
17
17
|
var types_exports = {};
|
|
18
18
|
module.exports = __toCommonJS(types_exports);
|
|
19
|
-
exports.default = module.exports;
|
|
19
|
+
if (module.exports.default) module.exports = module.exports.default;
|
package/dist/vite.cjs
CHANGED
|
@@ -58,6 +58,7 @@ __export(vite_exports, {
|
|
|
58
58
|
default: () => vite_default
|
|
59
59
|
});
|
|
60
60
|
module.exports = __toCommonJS(vite_exports);
|
|
61
|
+
var import_unplugin2 = require("unplugin");
|
|
61
62
|
|
|
62
63
|
// src/index.ts
|
|
63
64
|
var import_node_path2 = __toESM(require("path"), 1);
|
|
@@ -37070,19 +37071,19 @@ function countRouterView(code) {
|
|
|
37070
37071
|
return;
|
|
37071
37072
|
if (node2.children && node2.children.length > 0) {
|
|
37072
37073
|
node2.children.forEach((ele) => {
|
|
37073
|
-
traverse(ele);
|
|
37074
|
+
const res = traverse(ele);
|
|
37075
|
+
if (res) {
|
|
37076
|
+
const start = ele.loc.start.offset - node2.loc.start.offset;
|
|
37077
|
+
const end = ele.loc.end.offset - node2.loc.start.offset;
|
|
37078
|
+
before += node2.loc.source.substring(0, start);
|
|
37079
|
+
after += node2.loc.source.substring(end);
|
|
37080
|
+
}
|
|
37074
37081
|
});
|
|
37075
37082
|
return;
|
|
37076
37083
|
}
|
|
37077
37084
|
if (node2.tag === "router-view") {
|
|
37078
37085
|
++count;
|
|
37079
37086
|
return true;
|
|
37080
|
-
} else {
|
|
37081
|
-
if (count) {
|
|
37082
|
-
after += node2.loc.source;
|
|
37083
|
-
} else {
|
|
37084
|
-
before += node2.loc.source;
|
|
37085
|
-
}
|
|
37086
37087
|
}
|
|
37087
37088
|
}
|
|
37088
37089
|
traverse(ast);
|
|
@@ -37182,7 +37183,7 @@ function transform2(path4, code, entryPages, level) {
|
|
|
37182
37183
|
|
|
37183
37184
|
// src/index.ts
|
|
37184
37185
|
var NAME = "unplugin-mp-router-view";
|
|
37185
|
-
var
|
|
37186
|
+
var unpluginFactory = (options) => {
|
|
37186
37187
|
var _a, _b;
|
|
37187
37188
|
const log3 = (_a = options == null ? void 0 : options.log) != null ? _a : "error";
|
|
37188
37189
|
const entryPages = getPages((_b = options == null ? void 0 : options.collect) != null ? _b : true);
|
|
@@ -37198,10 +37199,10 @@ var src_default = (0, import_unplugin.createUnplugin)((options) => {
|
|
|
37198
37199
|
return res;
|
|
37199
37200
|
}
|
|
37200
37201
|
};
|
|
37201
|
-
}
|
|
37202
|
+
};
|
|
37202
37203
|
|
|
37203
37204
|
// src/vite.ts
|
|
37204
|
-
var vite_default =
|
|
37205
|
+
var vite_default = (0, import_unplugin2.createVitePlugin)(unpluginFactory);
|
|
37205
37206
|
// Annotate the CommonJS export names for ESM import in node:
|
|
37206
37207
|
0 && (module.exports = {});
|
|
37207
37208
|
/*!
|
|
@@ -37212,4 +37213,4 @@ var vite_default = src_default.vite;
|
|
|
37212
37213
|
*/
|
|
37213
37214
|
/*! https://mths.be/cssesc v3.0.0 by @mathias */
|
|
37214
37215
|
/*! https://mths.be/punycode v1.4.1 by @mathias */
|
|
37215
|
-
exports.default = module.exports;
|
|
37216
|
+
if (module.exports.default) module.exports = module.exports.default;
|
package/dist/vite.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
unpluginFactory
|
|
3
|
+
} from "./chunk-QNXQRN2I.js";
|
|
4
4
|
|
|
5
5
|
// src/vite.ts
|
|
6
|
-
|
|
6
|
+
import { createVitePlugin } from "unplugin";
|
|
7
|
+
var vite_default = createVitePlugin(unpluginFactory);
|
|
7
8
|
export {
|
|
8
9
|
vite_default as default
|
|
9
10
|
};
|
package/dist/webpack.cjs
CHANGED
|
@@ -58,38 +58,19 @@ __export(webpack_exports, {
|
|
|
58
58
|
default: () => webpack_default
|
|
59
59
|
});
|
|
60
60
|
module.exports = __toCommonJS(webpack_exports);
|
|
61
|
+
var import_unplugin2 = require("unplugin");
|
|
62
|
+
|
|
63
|
+
// src/index.ts
|
|
64
|
+
var import_node_path2 = __toESM(require("path"), 1);
|
|
65
|
+
var import_unplugin = require("unplugin");
|
|
61
66
|
|
|
62
67
|
// src/util/parse.ts
|
|
63
68
|
var import_node_fs = __toESM(require("fs"), 1);
|
|
64
|
-
var
|
|
69
|
+
var import_node_path = __toESM(require("path"), 1);
|
|
65
70
|
var import_jsonc_parser = require("jsonc-parser");
|
|
66
71
|
|
|
67
72
|
// src/util/error.ts
|
|
68
73
|
var import_colors = __toESM(require("colors"), 1);
|
|
69
|
-
|
|
70
|
-
// src/index.ts
|
|
71
|
-
var import_node_path = __toESM(require("path"), 1);
|
|
72
|
-
var import_unplugin = require("unplugin");
|
|
73
|
-
var NAME = "unplugin-mp-router-view";
|
|
74
|
-
var src_default = (0, import_unplugin.createUnplugin)((options) => {
|
|
75
|
-
var _a, _b;
|
|
76
|
-
const log3 = (_a = options == null ? void 0 : options.log) != null ? _a : "error";
|
|
77
|
-
const entryPages = getPages((_b = options == null ? void 0 : options.collect) != null ? _b : true);
|
|
78
|
-
return {
|
|
79
|
-
name: NAME,
|
|
80
|
-
enforce: "pre",
|
|
81
|
-
transformInclude(id2) {
|
|
82
|
-
const _id = import_node_path.default.resolve(id2);
|
|
83
|
-
return isAppVue(_id) || isEntryPage(_id, entryPages);
|
|
84
|
-
},
|
|
85
|
-
transform(code, id2) {
|
|
86
|
-
const res = transform(import_node_path.default.resolve(id2), code, entryPages, log3);
|
|
87
|
-
return res;
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
// src/util/error.ts
|
|
93
74
|
function genError(msg) {
|
|
94
75
|
return `${import_colors.default.yellow(`
|
|
95
76
|
[${NAME}]`)} ${import_colors.default.red(`\u2716 ${msg}`)}`;
|
|
@@ -14634,7 +14615,7 @@ function createTransformContext(root2, { filename = "", prefixIdentifiers = fals
|
|
|
14634
14615
|
}
|
|
14635
14616
|
return context;
|
|
14636
14617
|
}
|
|
14637
|
-
function
|
|
14618
|
+
function transform(root2, options) {
|
|
14638
14619
|
const context = createTransformContext(root2, options);
|
|
14639
14620
|
traverseNode(root2, context);
|
|
14640
14621
|
if (options.hoistStatic) {
|
|
@@ -19090,7 +19071,7 @@ function baseCompile(template, options = {}) {
|
|
|
19090
19071
|
options.expressionPlugins = [...expressionPlugins || [], "typescript"];
|
|
19091
19072
|
}
|
|
19092
19073
|
}
|
|
19093
|
-
|
|
19074
|
+
transform(ast, extend({}, options, {
|
|
19094
19075
|
prefixIdentifiers,
|
|
19095
19076
|
nodeTransforms: [
|
|
19096
19077
|
...nodeTransforms,
|
|
@@ -22029,7 +22010,7 @@ var CompilerDOM = /* @__PURE__ */ Object.freeze({
|
|
|
22029
22010
|
TRANSITION_GROUP,
|
|
22030
22011
|
baseCompile,
|
|
22031
22012
|
baseParse,
|
|
22032
|
-
transform
|
|
22013
|
+
transform,
|
|
22033
22014
|
createTransformContext,
|
|
22034
22015
|
traverseNode,
|
|
22035
22016
|
createStructuralDirectiveTransform,
|
|
@@ -24976,7 +24957,7 @@ function basename(path4, ext) {
|
|
|
24976
24957
|
function extname(path4) {
|
|
24977
24958
|
return splitPath(path4)[3];
|
|
24978
24959
|
}
|
|
24979
|
-
var
|
|
24960
|
+
var path = {
|
|
24980
24961
|
extname,
|
|
24981
24962
|
basename,
|
|
24982
24963
|
dirname,
|
|
@@ -25017,7 +24998,7 @@ var _polyfillNode_path = /* @__PURE__ */ Object.freeze({
|
|
|
25017
24998
|
dirname,
|
|
25018
24999
|
basename,
|
|
25019
25000
|
extname,
|
|
25020
|
-
"default":
|
|
25001
|
+
"default": path
|
|
25021
25002
|
});
|
|
25022
25003
|
var maxInt = 2147483647;
|
|
25023
25004
|
var base = 36;
|
|
@@ -26514,7 +26495,7 @@ var transformAssetUrl = (node2, context, options = defaultAssetUrlOptions) => {
|
|
|
26514
26495
|
const protocol = base2.protocol || "";
|
|
26515
26496
|
const host = base2.host ? protocol + "//" + base2.host : "";
|
|
26516
26497
|
const basePath = base2.path || "/";
|
|
26517
|
-
attr.value.content = host + (
|
|
26498
|
+
attr.value.content = host + (path.posix || path).join(basePath, url.path + (url.hash || ""));
|
|
26518
26499
|
return;
|
|
26519
26500
|
}
|
|
26520
26501
|
const exp = getImportsExpressionExp(url.path, url.hash, attr.loc, context);
|
|
@@ -26601,7 +26582,7 @@ var transformSrcset = (node2, context, options = defaultAssetUrlOptions) => {
|
|
|
26601
26582
|
let { url, descriptor } = candidate;
|
|
26602
26583
|
descriptor = descriptor ? ` ${descriptor}` : ``;
|
|
26603
26584
|
if (url[0] === ".") {
|
|
26604
|
-
candidate.url = (
|
|
26585
|
+
candidate.url = (path.posix || path).join(base2, url);
|
|
26605
26586
|
set.push(candidate.url + descriptor);
|
|
26606
26587
|
} else if (shouldProcessUrl(url)) {
|
|
26607
26588
|
needImportTransform = true;
|
|
@@ -27617,7 +27598,7 @@ function compile$1(template, options = {}) {
|
|
|
27617
27598
|
});
|
|
27618
27599
|
const ast = baseParse(template, options);
|
|
27619
27600
|
rawOptionsMap.set(ast, options);
|
|
27620
|
-
|
|
27601
|
+
transform(ast, Object.assign(Object.assign({}, options), { hoistStatic: false, nodeTransforms: [
|
|
27621
27602
|
ssrTransformIf,
|
|
27622
27603
|
ssrTransformFor,
|
|
27623
27604
|
trackVForSlotScopes,
|
|
@@ -27823,7 +27804,7 @@ function resolveTemplateUsageCheckString(sfc) {
|
|
|
27823
27804
|
return cached;
|
|
27824
27805
|
}
|
|
27825
27806
|
let code = "";
|
|
27826
|
-
|
|
27807
|
+
transform(createRoot([ast]), {
|
|
27827
27808
|
nodeTransforms: [
|
|
27828
27809
|
(node2) => {
|
|
27829
27810
|
if (node2.type === 1) {
|
|
@@ -37090,19 +37071,19 @@ function countRouterView(code) {
|
|
|
37090
37071
|
return;
|
|
37091
37072
|
if (node2.children && node2.children.length > 0) {
|
|
37092
37073
|
node2.children.forEach((ele) => {
|
|
37093
|
-
traverse(ele);
|
|
37074
|
+
const res = traverse(ele);
|
|
37075
|
+
if (res) {
|
|
37076
|
+
const start = ele.loc.start.offset - node2.loc.start.offset;
|
|
37077
|
+
const end = ele.loc.end.offset - node2.loc.start.offset;
|
|
37078
|
+
before += node2.loc.source.substring(0, start);
|
|
37079
|
+
after += node2.loc.source.substring(end);
|
|
37080
|
+
}
|
|
37094
37081
|
});
|
|
37095
37082
|
return;
|
|
37096
37083
|
}
|
|
37097
37084
|
if (node2.tag === "router-view") {
|
|
37098
37085
|
++count;
|
|
37099
37086
|
return true;
|
|
37100
|
-
} else {
|
|
37101
|
-
if (count) {
|
|
37102
|
-
after += node2.loc.source;
|
|
37103
|
-
} else {
|
|
37104
|
-
before += node2.loc.source;
|
|
37105
|
-
}
|
|
37106
37087
|
}
|
|
37107
37088
|
}
|
|
37108
37089
|
traverse(ast);
|
|
@@ -37143,7 +37124,7 @@ function addToFooter(code, footer2) {
|
|
|
37143
37124
|
return code.replace(/(<\/view>)(\s*)(<\/template>)(?!(([\s\S]*)(<\/template>)))/, (p) => footer2 + p);
|
|
37144
37125
|
}
|
|
37145
37126
|
function getPages(collectMode) {
|
|
37146
|
-
const jsonStr = import_node_fs.default.readFileSync(
|
|
37127
|
+
const jsonStr = import_node_fs.default.readFileSync(import_node_path.default.resolve(INPUT_DIR, "pages.json"), "utf-8");
|
|
37147
37128
|
const pagesJson = parseJson(jsonStr);
|
|
37148
37129
|
const { pages, subPackages = [] } = pagesJson;
|
|
37149
37130
|
const entryList = [...collectEntry(collectMode, pages), ...collectEntry(collectMode, subPackages)];
|
|
@@ -37159,7 +37140,7 @@ function collectEntry(collectMode, json, root2 = "") {
|
|
|
37159
37140
|
if (!collectMode) {
|
|
37160
37141
|
return;
|
|
37161
37142
|
}
|
|
37162
|
-
const _path2 =
|
|
37143
|
+
const _path2 = import_node_path.default.resolve(INPUT_DIR, `${root2}${root2 ? "/" : ""}${item.path}`);
|
|
37163
37144
|
if (collectMode && typeof collectMode === "boolean" && !item["ROUTER_VIEW_EXCLUDE"]) {
|
|
37164
37145
|
entryList.push(_path2);
|
|
37165
37146
|
} else if (typeof collectMode === "string" && item[collectMode]) {
|
|
@@ -37179,7 +37160,7 @@ function combineCode(code, header2, footer2) {
|
|
|
37179
37160
|
code = addToFooter(code, footer2);
|
|
37180
37161
|
return code;
|
|
37181
37162
|
}
|
|
37182
|
-
function
|
|
37163
|
+
function transform2(path4, code, entryPages, level) {
|
|
37183
37164
|
logLevel = level;
|
|
37184
37165
|
if (isAppVue(path4)) {
|
|
37185
37166
|
log(`\u57FA\u4E8E\u5E73\u53F0${process.env.UNI_PLATFORM}, \u5904\u7406App.vue...`, logLevel);
|
|
@@ -37200,13 +37181,28 @@ function transform(path4, code, entryPages, level) {
|
|
|
37200
37181
|
return code;
|
|
37201
37182
|
}
|
|
37202
37183
|
|
|
37203
|
-
// src/
|
|
37204
|
-
|
|
37184
|
+
// src/index.ts
|
|
37185
|
+
var NAME = "unplugin-mp-router-view";
|
|
37186
|
+
var unpluginFactory = (options) => {
|
|
37205
37187
|
var _a, _b;
|
|
37206
|
-
const
|
|
37207
|
-
const entryPages = getPages(collect);
|
|
37208
|
-
return
|
|
37209
|
-
|
|
37188
|
+
const log3 = (_a = options == null ? void 0 : options.log) != null ? _a : "error";
|
|
37189
|
+
const entryPages = getPages((_b = options == null ? void 0 : options.collect) != null ? _b : true);
|
|
37190
|
+
return {
|
|
37191
|
+
name: NAME,
|
|
37192
|
+
enforce: "pre",
|
|
37193
|
+
transformInclude(id2) {
|
|
37194
|
+
const _id = import_node_path2.default.resolve(id2);
|
|
37195
|
+
return isAppVue(_id) || isEntryPage(_id, entryPages);
|
|
37196
|
+
},
|
|
37197
|
+
transform(code, id2) {
|
|
37198
|
+
const res = transform2(import_node_path2.default.resolve(id2), code, entryPages, log3);
|
|
37199
|
+
return res;
|
|
37200
|
+
}
|
|
37201
|
+
};
|
|
37202
|
+
};
|
|
37203
|
+
|
|
37204
|
+
// src/webpack.ts
|
|
37205
|
+
var webpack_default = (0, import_unplugin2.createWebpackPlugin)(unpluginFactory);
|
|
37210
37206
|
// Annotate the CommonJS export names for ESM import in node:
|
|
37211
37207
|
0 && (module.exports = {});
|
|
37212
37208
|
/*!
|
|
@@ -37217,4 +37213,4 @@ function webpack_default(code) {
|
|
|
37217
37213
|
*/
|
|
37218
37214
|
/*! https://mths.be/cssesc v3.0.0 by @mathias */
|
|
37219
37215
|
/*! https://mths.be/punycode v1.4.1 by @mathias */
|
|
37220
|
-
exports.default = module.exports;
|
|
37216
|
+
if (module.exports.default) module.exports = module.exports.default;
|
package/dist/webpack.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as webpack from 'webpack';
|
|
2
2
|
import { Options } from './types.js';
|
|
3
3
|
|
|
4
|
-
declare
|
|
4
|
+
declare const _default: (options?: Options | undefined) => webpack.WebpackPluginInstance;
|
|
5
5
|
|
|
6
|
-
export {
|
|
6
|
+
export { _default as default };
|
package/dist/webpack.js
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "./chunk-673IL366.js";
|
|
2
|
+
unpluginFactory
|
|
3
|
+
} from "./chunk-QNXQRN2I.js";
|
|
5
4
|
|
|
6
5
|
// src/webpack.ts
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const { log = "error", collect = true } = (_b = (_a = this.getOptions) == null ? void 0 : _a.call(this)) != null ? _b : this.query;
|
|
10
|
-
const entryPages = getPages(collect);
|
|
11
|
-
return transform(this.resourcePath, code, entryPages, log);
|
|
12
|
-
}
|
|
6
|
+
import { createWebpackPlugin } from "unplugin";
|
|
7
|
+
var webpack_default = createWebpackPlugin(unpluginFactory);
|
|
13
8
|
export {
|
|
14
9
|
webpack_default as default
|
|
15
10
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sepveneto/plugin-mp-router-view",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.5",
|
|
5
5
|
"packageManager": "pnpm@7.1.1",
|
|
6
6
|
"description": "Register global imports on demand for Vite and Webpack",
|
|
7
7
|
"license": "MIT",
|
|
@@ -26,6 +26,11 @@
|
|
|
26
26
|
"require": "./dist/webpack.cjs",
|
|
27
27
|
"import": "./dist/webpack.js"
|
|
28
28
|
},
|
|
29
|
+
"./loader": {
|
|
30
|
+
"types": "./dist/loader.d.ts",
|
|
31
|
+
"require": "./dist/loader.cjs",
|
|
32
|
+
"import": "./dist/loader.js"
|
|
33
|
+
},
|
|
29
34
|
"./vite": {
|
|
30
35
|
"types": "./dist/vite.d.ts",
|
|
31
36
|
"require": "./dist/vite.cjs",
|
|
@@ -69,10 +74,10 @@
|
|
|
69
74
|
],
|
|
70
75
|
"dependencies": {
|
|
71
76
|
"colors": "^1.4.0",
|
|
77
|
+
"debug": "^4.3.4",
|
|
72
78
|
"jsonc-parser": "^3.2.0",
|
|
73
79
|
"node-html-parser": "^6.1.4",
|
|
74
|
-
"
|
|
75
|
-
"unplugin": "^1.0.1"
|
|
80
|
+
"unplugin": "^1.4.0"
|
|
76
81
|
},
|
|
77
82
|
"devDependencies": {
|
|
78
83
|
"@antfu/eslint-config": "^0.33.1",
|
package/dist/nuxt.d.ts
DELETED
package/dist/nuxt.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
src_default
|
|
3
|
-
} from "./chunk-673IL366.js";
|
|
4
|
-
|
|
5
|
-
// src/nuxt.ts
|
|
6
|
-
function nuxt_default(options = {}, nuxt) {
|
|
7
|
-
nuxt.hook("webpack:config", async (config) => {
|
|
8
|
-
config.plugins = config.plugins || [];
|
|
9
|
-
config.plugins.unshift(src_default.webpack(options));
|
|
10
|
-
});
|
|
11
|
-
nuxt.hook("vite:extendConfig", async (config) => {
|
|
12
|
-
config.plugins = config.plugins || [];
|
|
13
|
-
config.plugins.push(src_default.vite(options));
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
export {
|
|
17
|
-
nuxt_default as default
|
|
18
|
-
};
|