@sepveneto/plugin-mp-router-view 0.3.2 → 0.3.4

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 CHANGED
@@ -11,9 +11,9 @@
11
11
 
12
12
  ### 安装
13
13
  ```bash
14
- npm i @sepvenet/plugin-mp-router-view
15
- yarn add @sepvenet/plugin-mp-router-view
16
- pnpm i @sepvenet/plugin-mp-router-view
14
+ npm i @sepveneto/plugin-mp-router-view
15
+ yarn add @sepveneto/plugin-mp-router-view
16
+ pnpm i @sepveneto/plugin-mp-router-view
17
17
  ```
18
18
 
19
19
  ### 使用
@@ -37054,12 +37054,6 @@ function countRouterView(code) {
37054
37054
  if (node2.tag === "router-view") {
37055
37055
  ++count;
37056
37056
  return true;
37057
- } else {
37058
- if (count) {
37059
- after += node2.loc.source;
37060
- } else {
37061
- before += node2.loc.source;
37062
- }
37063
37057
  }
37064
37058
  }
37065
37059
  traverse(ast);
@@ -37159,7 +37153,7 @@ function transform2(path4, code, entryPages, level) {
37159
37153
 
37160
37154
  // src/index.ts
37161
37155
  var NAME = "unplugin-mp-router-view";
37162
- var src_default = createUnplugin((options) => {
37156
+ var unpluginFactory = (options) => {
37163
37157
  var _a, _b;
37164
37158
  const log3 = (_a = options == null ? void 0 : options.log) != null ? _a : "error";
37165
37159
  const entryPages = getPages((_b = options == null ? void 0 : options.collect) != null ? _b : true);
@@ -37175,12 +37169,14 @@ var src_default = createUnplugin((options) => {
37175
37169
  return res;
37176
37170
  }
37177
37171
  };
37178
- });
37172
+ };
37173
+ var unplugin = /* @__PURE__ */ createUnplugin(unpluginFactory);
37174
+ var src_default = unplugin;
37179
37175
 
37180
37176
  export {
37181
- getPages,
37182
- transform2 as transform,
37183
37177
  NAME,
37178
+ unpluginFactory,
37179
+ unplugin,
37184
37180
  src_default
37185
37181
  };
37186
37182
  /*!
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);
@@ -37083,12 +37084,6 @@ function countRouterView(code) {
37083
37084
  if (node2.tag === "router-view") {
37084
37085
  ++count;
37085
37086
  return true;
37086
- } else {
37087
- if (count) {
37088
- after += node2.loc.source;
37089
- } else {
37090
- before += node2.loc.source;
37091
- }
37092
37087
  }
37093
37088
  }
37094
37089
  traverse(ast);
@@ -37188,7 +37183,7 @@ function transform2(path4, code, entryPages, level) {
37188
37183
 
37189
37184
  // src/index.ts
37190
37185
  var NAME = "unplugin-mp-router-view";
37191
- var src_default = (0, import_unplugin.createUnplugin)((options) => {
37186
+ var unpluginFactory = (options) => {
37192
37187
  var _a, _b;
37193
37188
  const log3 = (_a = options == null ? void 0 : options.log) != null ? _a : "error";
37194
37189
  const entryPages = getPages((_b = options == null ? void 0 : options.collect) != null ? _b : true);
@@ -37204,10 +37199,10 @@ var src_default = (0, import_unplugin.createUnplugin)((options) => {
37204
37199
  return res;
37205
37200
  }
37206
37201
  };
37207
- });
37202
+ };
37208
37203
 
37209
37204
  // src/esbuild.ts
37210
- var esbuild_default = src_default.esbuild;
37205
+ var esbuild_default = (0, import_unplugin2.createEsbuildPlugin)(unpluginFactory);
37211
37206
  // Annotate the CommonJS export names for ESM import in node:
37212
37207
  0 && (module.exports = {});
37213
37208
  /*!
@@ -37218,4 +37213,4 @@ var esbuild_default = src_default.esbuild;
37218
37213
  */
37219
37214
  /*! https://mths.be/cssesc v3.0.0 by @mathias */
37220
37215
  /*! https://mths.be/punycode v1.4.1 by @mathias */
37221
- 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
- src_default
3
- } from "./chunk-ID2REES4.js";
2
+ unpluginFactory
3
+ } from "./chunk-TUTSLW5Q.js";
4
4
 
5
5
  // src/esbuild.ts
6
- var esbuild_default = src_default.esbuild;
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);
@@ -37082,12 +37084,6 @@ function countRouterView(code) {
37082
37084
  if (node2.tag === "router-view") {
37083
37085
  ++count;
37084
37086
  return true;
37085
- } else {
37086
- if (count) {
37087
- after += node2.loc.source;
37088
- } else {
37089
- before += node2.loc.source;
37090
- }
37091
37087
  }
37092
37088
  }
37093
37089
  traverse(ast);
@@ -37187,7 +37183,7 @@ function transform2(path4, code, entryPages, level) {
37187
37183
 
37188
37184
  // src/index.ts
37189
37185
  var NAME = "unplugin-mp-router-view";
37190
- var src_default = (0, import_unplugin.createUnplugin)((options) => {
37186
+ var unpluginFactory = (options) => {
37191
37187
  var _a, _b;
37192
37188
  const log3 = (_a = options == null ? void 0 : options.log) != null ? _a : "error";
37193
37189
  const entryPages = getPages((_b = options == null ? void 0 : options.collect) != null ? _b : true);
@@ -37203,10 +37199,14 @@ var src_default = (0, import_unplugin.createUnplugin)((options) => {
37203
37199
  return res;
37204
37200
  }
37205
37201
  };
37206
- });
37202
+ };
37203
+ var unplugin = /* @__PURE__ */ (0, import_unplugin.createUnplugin)(unpluginFactory);
37204
+ var src_default = unplugin;
37207
37205
  // Annotate the CommonJS export names for ESM import in node:
37208
37206
  0 && (module.exports = {
37209
- NAME
37207
+ NAME,
37208
+ unplugin,
37209
+ unpluginFactory
37210
37210
  });
37211
37211
  /*!
37212
37212
  * The buffer module from node.js, for the browser.
@@ -37216,4 +37216,4 @@ var src_default = (0, import_unplugin.createUnplugin)((options) => {
37216
37216
  */
37217
37217
  /*! https://mths.be/cssesc v3.0.0 by @mathias */
37218
37218
  /*! https://mths.be/punycode v1.4.1 by @mathias */
37219
- 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 unplugin from 'unplugin';
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 _default: unplugin.UnpluginInstance<Options | undefined, boolean>;
6
+ declare const unpluginFactory: UnpluginFactory<Options | undefined>;
7
+ declare const unplugin: _unplugin.UnpluginInstance<Options | undefined, boolean>;
6
8
 
7
- export { NAME, _default as default };
9
+ export { NAME, unplugin as default, unplugin, unpluginFactory };
package/dist/index.js CHANGED
@@ -1,8 +1,12 @@
1
1
  import {
2
2
  NAME,
3
- src_default
4
- } from "./chunk-ID2REES4.js";
3
+ src_default,
4
+ unplugin,
5
+ unpluginFactory
6
+ } from "./chunk-TUTSLW5Q.js";
5
7
  export {
6
8
  NAME,
7
- src_default as default
9
+ src_default as default,
10
+ unplugin,
11
+ unpluginFactory
8
12
  };
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);
@@ -37083,12 +37084,6 @@ function countRouterView(code) {
37083
37084
  if (node2.tag === "router-view") {
37084
37085
  ++count;
37085
37086
  return true;
37086
- } else {
37087
- if (count) {
37088
- after += node2.loc.source;
37089
- } else {
37090
- before += node2.loc.source;
37091
- }
37092
37087
  }
37093
37088
  }
37094
37089
  traverse(ast);
@@ -37188,7 +37183,7 @@ function transform2(path4, code, entryPages, level) {
37188
37183
 
37189
37184
  // src/index.ts
37190
37185
  var NAME = "unplugin-mp-router-view";
37191
- var src_default = (0, import_unplugin.createUnplugin)((options) => {
37186
+ var unpluginFactory = (options) => {
37192
37187
  var _a, _b;
37193
37188
  const log3 = (_a = options == null ? void 0 : options.log) != null ? _a : "error";
37194
37189
  const entryPages = getPages((_b = options == null ? void 0 : options.collect) != null ? _b : true);
@@ -37204,10 +37199,10 @@ var src_default = (0, import_unplugin.createUnplugin)((options) => {
37204
37199
  return res;
37205
37200
  }
37206
37201
  };
37207
- });
37202
+ };
37208
37203
 
37209
37204
  // src/rollup.ts
37210
- var rollup_default = src_default.rollup;
37205
+ var rollup_default = (0, import_unplugin2.createRollupPlugin)(unpluginFactory);
37211
37206
  // Annotate the CommonJS export names for ESM import in node:
37212
37207
  0 && (module.exports = {});
37213
37208
  /*!
@@ -37218,4 +37213,4 @@ var rollup_default = src_default.rollup;
37218
37213
  */
37219
37214
  /*! https://mths.be/cssesc v3.0.0 by @mathias */
37220
37215
  /*! https://mths.be/punycode v1.4.1 by @mathias */
37221
- 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
- src_default
3
- } from "./chunk-ID2REES4.js";
2
+ unpluginFactory
3
+ } from "./chunk-TUTSLW5Q.js";
4
4
 
5
5
  // src/rollup.ts
6
- var rollup_default = src_default.rollup;
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);
@@ -37083,12 +37084,6 @@ function countRouterView(code) {
37083
37084
  if (node2.tag === "router-view") {
37084
37085
  ++count;
37085
37086
  return true;
37086
- } else {
37087
- if (count) {
37088
- after += node2.loc.source;
37089
- } else {
37090
- before += node2.loc.source;
37091
- }
37092
37087
  }
37093
37088
  }
37094
37089
  traverse(ast);
@@ -37188,7 +37183,7 @@ function transform2(path4, code, entryPages, level) {
37188
37183
 
37189
37184
  // src/index.ts
37190
37185
  var NAME = "unplugin-mp-router-view";
37191
- var src_default = (0, import_unplugin.createUnplugin)((options) => {
37186
+ var unpluginFactory = (options) => {
37192
37187
  var _a, _b;
37193
37188
  const log3 = (_a = options == null ? void 0 : options.log) != null ? _a : "error";
37194
37189
  const entryPages = getPages((_b = options == null ? void 0 : options.collect) != null ? _b : true);
@@ -37204,10 +37199,10 @@ var src_default = (0, import_unplugin.createUnplugin)((options) => {
37204
37199
  return res;
37205
37200
  }
37206
37201
  };
37207
- });
37202
+ };
37208
37203
 
37209
37204
  // src/vite.ts
37210
- var vite_default = src_default.vite;
37205
+ var vite_default = (0, import_unplugin2.createVitePlugin)(unpluginFactory);
37211
37206
  // Annotate the CommonJS export names for ESM import in node:
37212
37207
  0 && (module.exports = {});
37213
37208
  /*!
@@ -37218,4 +37213,4 @@ var vite_default = src_default.vite;
37218
37213
  */
37219
37214
  /*! https://mths.be/cssesc v3.0.0 by @mathias */
37220
37215
  /*! https://mths.be/punycode v1.4.1 by @mathias */
37221
- 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
- src_default
3
- } from "./chunk-ID2REES4.js";
2
+ unpluginFactory
3
+ } from "./chunk-TUTSLW5Q.js";
4
4
 
5
5
  // src/vite.ts
6
- var vite_default = src_default.vite;
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 import_node_path2 = __toESM(require("path"), 1);
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 transform2(root2, options) {
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
- transform2(ast, extend({}, options, {
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: transform2,
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 path2 = {
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": path2
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 + (path2.posix || path2).join(basePath, url.path + (url.hash || ""));
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 = (path2.posix || path2).join(base2, 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
- transform2(ast, Object.assign(Object.assign({}, options), { hoistStatic: false, nodeTransforms: [
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
- transform2(createRoot([ast]), {
27807
+ transform(createRoot([ast]), {
27827
27808
  nodeTransforms: [
27828
27809
  (node2) => {
27829
27810
  if (node2.type === 1) {
@@ -37103,12 +37084,6 @@ function countRouterView(code) {
37103
37084
  if (node2.tag === "router-view") {
37104
37085
  ++count;
37105
37086
  return true;
37106
- } else {
37107
- if (count) {
37108
- after += node2.loc.source;
37109
- } else {
37110
- before += node2.loc.source;
37111
- }
37112
37087
  }
37113
37088
  }
37114
37089
  traverse(ast);
@@ -37149,7 +37124,7 @@ function addToFooter(code, footer2) {
37149
37124
  return code.replace(/(<\/view>)(\s*)(<\/template>)(?!(([\s\S]*)(<\/template>)))/, (p) => footer2 + p);
37150
37125
  }
37151
37126
  function getPages(collectMode) {
37152
- const jsonStr = import_node_fs.default.readFileSync(import_node_path2.default.resolve(INPUT_DIR, "pages.json"), "utf-8");
37127
+ const jsonStr = import_node_fs.default.readFileSync(import_node_path.default.resolve(INPUT_DIR, "pages.json"), "utf-8");
37153
37128
  const pagesJson = parseJson(jsonStr);
37154
37129
  const { pages, subPackages = [] } = pagesJson;
37155
37130
  const entryList = [...collectEntry(collectMode, pages), ...collectEntry(collectMode, subPackages)];
@@ -37165,7 +37140,7 @@ function collectEntry(collectMode, json, root2 = "") {
37165
37140
  if (!collectMode) {
37166
37141
  return;
37167
37142
  }
37168
- const _path2 = import_node_path2.default.resolve(INPUT_DIR, `${root2}${root2 ? "/" : ""}${item.path}`);
37143
+ const _path2 = import_node_path.default.resolve(INPUT_DIR, `${root2}${root2 ? "/" : ""}${item.path}`);
37169
37144
  if (collectMode && typeof collectMode === "boolean" && !item["ROUTER_VIEW_EXCLUDE"]) {
37170
37145
  entryList.push(_path2);
37171
37146
  } else if (typeof collectMode === "string" && item[collectMode]) {
@@ -37185,7 +37160,7 @@ function combineCode(code, header2, footer2) {
37185
37160
  code = addToFooter(code, footer2);
37186
37161
  return code;
37187
37162
  }
37188
- function transform(path4, code, entryPages, level) {
37163
+ function transform2(path4, code, entryPages, level) {
37189
37164
  logLevel = level;
37190
37165
  if (isAppVue(path4)) {
37191
37166
  log(`\u57FA\u4E8E\u5E73\u53F0${process.env.UNI_PLATFORM}, \u5904\u7406App.vue...`, logLevel);
@@ -37206,13 +37181,28 @@ function transform(path4, code, entryPages, level) {
37206
37181
  return code;
37207
37182
  }
37208
37183
 
37209
- // src/webpack.ts
37210
- function webpack_default(code) {
37184
+ // src/index.ts
37185
+ var NAME = "unplugin-mp-router-view";
37186
+ var unpluginFactory = (options) => {
37211
37187
  var _a, _b;
37212
- const { log: log3 = "error", collect = true } = (_b = (_a = this.getOptions) == null ? void 0 : _a.call(this)) != null ? _b : this.query;
37213
- const entryPages = getPages(collect);
37214
- return transform(this.resourcePath, code, entryPages, log3);
37215
- }
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);
37216
37206
  // Annotate the CommonJS export names for ESM import in node:
37217
37207
  0 && (module.exports = {});
37218
37208
  /*!
@@ -37223,4 +37213,4 @@ function webpack_default(code) {
37223
37213
  */
37224
37214
  /*! https://mths.be/cssesc v3.0.0 by @mathias */
37225
37215
  /*! https://mths.be/punycode v1.4.1 by @mathias */
37226
- 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 function export_default(this: webpack.LoaderContext<Options>, code: string): string;
4
+ declare const _default: (options?: Options | undefined) => webpack.WebpackPluginInstance;
5
5
 
6
- export { export_default as default };
6
+ export { _default as default };
package/dist/webpack.js CHANGED
@@ -1,15 +1,10 @@
1
1
  import {
2
- getPages,
3
- transform
4
- } from "./chunk-ID2REES4.js";
2
+ unpluginFactory
3
+ } from "./chunk-TUTSLW5Q.js";
5
4
 
6
5
  // src/webpack.ts
7
- function webpack_default(code) {
8
- var _a, _b;
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.2",
4
+ "version": "0.3.4",
5
5
  "packageManager": "pnpm@7.1.1",
6
6
  "description": "Register global imports on demand for Vite and Webpack",
7
7
  "license": "MIT",
@@ -69,10 +69,10 @@
69
69
  ],
70
70
  "dependencies": {
71
71
  "colors": "^1.4.0",
72
+ "debug": "^4.3.4",
72
73
  "jsonc-parser": "^3.2.0",
73
74
  "node-html-parser": "^6.1.4",
74
- "debug": "^4.3.4",
75
- "unplugin": "^1.0.1"
75
+ "unplugin": "^1.4.0"
76
76
  },
77
77
  "devDependencies": {
78
78
  "@antfu/eslint-config": "^0.33.1",