weapp-vite 5.7.2 → 5.9.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.
@@ -2678,9 +2678,152 @@ function resolveBaseDir(configService) {
2678
2678
  }
2679
2679
  return configService.cwd;
2680
2680
  }
2681
+ function cloneAutoImportComponents(config) {
2682
+ if (!config || config === false) {
2683
+ return void 0;
2684
+ }
2685
+ const cloned = {};
2686
+ if (_optionalChain([config, 'access', _63 => _63.globs, 'optionalAccess', _64 => _64.length])) {
2687
+ cloned.globs = [...config.globs];
2688
+ }
2689
+ if (_optionalChain([config, 'access', _65 => _65.resolvers, 'optionalAccess', _66 => _66.length])) {
2690
+ cloned.resolvers = [...config.resolvers];
2691
+ }
2692
+ if (config.output !== void 0) {
2693
+ cloned.output = config.output;
2694
+ }
2695
+ if (config.typedComponents !== void 0) {
2696
+ cloned.typedComponents = config.typedComponents;
2697
+ }
2698
+ if (config.htmlCustomData !== void 0) {
2699
+ cloned.htmlCustomData = config.htmlCustomData;
2700
+ }
2701
+ return cloned;
2702
+ }
2703
+ function mergeGlobs(base, extra) {
2704
+ const values = [
2705
+ ..._nullishCoalesce(base, () => ( [])),
2706
+ ..._nullishCoalesce(extra, () => ( []))
2707
+ ].map((entry) => _optionalChain([entry, 'optionalAccess', _67 => _67.trim, 'call', _68 => _68()])).filter((entry) => Boolean(entry));
2708
+ if (!values.length) {
2709
+ return void 0;
2710
+ }
2711
+ const deduped = [];
2712
+ const seen = /* @__PURE__ */ new Set();
2713
+ for (const entry of values) {
2714
+ if (seen.has(entry)) {
2715
+ continue;
2716
+ }
2717
+ seen.add(entry);
2718
+ deduped.push(entry);
2719
+ }
2720
+ return deduped;
2721
+ }
2722
+ function mergeResolvers(base, extra) {
2723
+ const merged = [
2724
+ ..._nullishCoalesce(base, () => ( [])),
2725
+ ..._nullishCoalesce(extra, () => ( []))
2726
+ ].filter(Boolean);
2727
+ return merged.length ? merged : void 0;
2728
+ }
2729
+ function mergeAutoImportComponents(lower, upper, preferUpperScalars = false) {
2730
+ if (!lower && !upper) {
2731
+ return void 0;
2732
+ }
2733
+ if (!lower) {
2734
+ return cloneAutoImportComponents(upper);
2735
+ }
2736
+ if (!upper) {
2737
+ return cloneAutoImportComponents(lower);
2738
+ }
2739
+ const merged = {};
2740
+ const globs = mergeGlobs(lower.globs, upper.globs);
2741
+ if (globs) {
2742
+ merged.globs = globs;
2743
+ }
2744
+ const resolvers = mergeResolvers(lower.resolvers, upper.resolvers);
2745
+ if (resolvers) {
2746
+ merged.resolvers = resolvers;
2747
+ }
2748
+ const pickScalar = (baseline, candidate) => {
2749
+ return preferUpperScalars ? _nullishCoalesce(candidate, () => ( baseline)) : _nullishCoalesce(baseline, () => ( candidate));
2750
+ };
2751
+ const output = pickScalar(lower.output, upper.output);
2752
+ if (output !== void 0) {
2753
+ merged.output = output;
2754
+ }
2755
+ const typedComponents = pickScalar(lower.typedComponents, upper.typedComponents);
2756
+ if (typedComponents !== void 0) {
2757
+ merged.typedComponents = typedComponents;
2758
+ }
2759
+ const htmlCustomData = pickScalar(lower.htmlCustomData, upper.htmlCustomData);
2760
+ if (htmlCustomData !== void 0) {
2761
+ merged.htmlCustomData = htmlCustomData;
2762
+ }
2763
+ return merged;
2764
+ }
2765
+ function normalizeGlobRoot(root) {
2766
+ return root.replace(/\\/g, "/").replace(/^\/+|\/+$/g, "");
2767
+ }
2768
+ function createDefaultAutoImportComponents(configService) {
2769
+ const globs = /* @__PURE__ */ new Set();
2770
+ globs.add("components/**/*.wxml");
2771
+ const subPackages = _optionalChain([configService, 'access', _69 => _69.weappViteConfig, 'optionalAccess', _70 => _70.subPackages]);
2772
+ if (subPackages) {
2773
+ for (const [root, subConfig] of Object.entries(subPackages)) {
2774
+ if (!root) {
2775
+ continue;
2776
+ }
2777
+ if (_optionalChain([subConfig, 'optionalAccess', _71 => _71.autoImportComponents]) === false) {
2778
+ continue;
2779
+ }
2780
+ const normalized = normalizeGlobRoot(root);
2781
+ if (!normalized) {
2782
+ continue;
2783
+ }
2784
+ globs.add(`${normalized}/components/**/*.wxml`);
2785
+ }
2786
+ }
2787
+ return globs.size ? { globs: Array.from(globs) } : void 0;
2788
+ }
2681
2789
  function getAutoImportConfig(configService) {
2682
- const weappConfig = _optionalChain([configService, 'optionalAccess', _63 => _63.weappViteConfig]);
2683
- return _nullishCoalesce(_optionalChain([weappConfig, 'optionalAccess', _64 => _64.autoImportComponents]), () => ( _optionalChain([weappConfig, 'optionalAccess', _65 => _65.enhance, 'optionalAccess', _66 => _66.autoImportComponents])));
2790
+ if (!configService) {
2791
+ return void 0;
2792
+ }
2793
+ const weappConfig = configService.weappViteConfig;
2794
+ if (!weappConfig) {
2795
+ return void 0;
2796
+ }
2797
+ const userConfigured = _nullishCoalesce(weappConfig.autoImportComponents, () => ( _optionalChain([weappConfig, 'access', _72 => _72.enhance, 'optionalAccess', _73 => _73.autoImportComponents])));
2798
+ if (userConfigured === false) {
2799
+ return void 0;
2800
+ }
2801
+ const fallbackConfig = userConfigured === void 0 ? createDefaultAutoImportComponents(configService) : void 0;
2802
+ const baseConfig = cloneAutoImportComponents(_nullishCoalesce(userConfigured, () => ( fallbackConfig)));
2803
+ const subPackageConfigs = weappConfig.subPackages;
2804
+ const currentRoot = configService.currentSubPackageRoot;
2805
+ if (currentRoot) {
2806
+ const scopedRaw = _optionalChain([subPackageConfigs, 'optionalAccess', _74 => _74[currentRoot], 'optionalAccess', _75 => _75.autoImportComponents]);
2807
+ if (scopedRaw === false) {
2808
+ return void 0;
2809
+ }
2810
+ const scoped = cloneAutoImportComponents(scopedRaw);
2811
+ return _nullishCoalesce(_nullishCoalesce(mergeAutoImportComponents(baseConfig, scoped, true), () => ( baseConfig)), () => ( scoped));
2812
+ }
2813
+ let merged = baseConfig;
2814
+ if (subPackageConfigs) {
2815
+ for (const root of Object.keys(subPackageConfigs)) {
2816
+ const scopedRaw = _optionalChain([subPackageConfigs, 'access', _76 => _76[root], 'optionalAccess', _77 => _77.autoImportComponents]);
2817
+ if (!scopedRaw || scopedRaw === false) {
2818
+ continue;
2819
+ }
2820
+ const scoped = cloneAutoImportComponents(scopedRaw);
2821
+ if (scoped && scoped !== false) {
2822
+ merged = mergeAutoImportComponents(merged, scoped, false);
2823
+ }
2824
+ }
2825
+ }
2826
+ return merged;
2684
2827
  }
2685
2828
  function resolveManifestOutputPath(configService, manifestFileName = DEFAULT_AUTO_IMPORT_MANIFEST_FILENAME) {
2686
2829
  if (!configService) {
@@ -2712,7 +2855,7 @@ function getTypedComponentsSettings(ctx) {
2712
2855
  return { enabled: false };
2713
2856
  }
2714
2857
  const autoImportConfig = getAutoImportConfig(configService);
2715
- const option = _optionalChain([autoImportConfig, 'optionalAccess', _67 => _67.typedComponents]);
2858
+ const option = _optionalChain([autoImportConfig, 'optionalAccess', _78 => _78.typedComponents]);
2716
2859
  if (option === true) {
2717
2860
  return {
2718
2861
  enabled: true,
@@ -2739,7 +2882,7 @@ function getHtmlCustomDataSettings(ctx) {
2739
2882
  return { enabled: false };
2740
2883
  }
2741
2884
  const autoImportConfig = getAutoImportConfig(configService);
2742
- const option = _optionalChain([autoImportConfig, 'optionalAccess', _68 => _68.htmlCustomData]);
2885
+ const option = _optionalChain([autoImportConfig, 'optionalAccess', _79 => _79.htmlCustomData]);
2743
2886
  if (option === true) {
2744
2887
  return {
2745
2888
  enabled: true,
@@ -2952,13 +3095,13 @@ function createAutoImportService(ctx) {
2952
3095
  let lastWrittenHtmlCustomData;
2953
3096
  let lastHtmlCustomDataOutputPath;
2954
3097
  function collectResolverComponents() {
2955
- const resolvers = _optionalChain([getAutoImportConfig, 'call', _69 => _69(ctx.configService), 'optionalAccess', _70 => _70.resolvers]);
3098
+ const resolvers = _optionalChain([getAutoImportConfig, 'call', _80 => _80(ctx.configService), 'optionalAccess', _81 => _81.resolvers]);
2956
3099
  if (!Array.isArray(resolvers)) {
2957
3100
  return {};
2958
3101
  }
2959
3102
  const entries = [];
2960
3103
  for (const resolver of resolvers) {
2961
- const map = _optionalChain([resolver, 'optionalAccess', _71 => _71.components]);
3104
+ const map = _optionalChain([resolver, 'optionalAccess', _82 => _82.components]);
2962
3105
  if (!map) {
2963
3106
  continue;
2964
3107
  }
@@ -3004,11 +3147,11 @@ function createAutoImportService(ctx) {
3004
3147
  }
3005
3148
  const configService = ctx.configService;
3006
3149
  if (configService) {
3007
- const from = _optionalChain([record, 'access', _72 => _72.value, 'access', _73 => _73.from, 'optionalAccess', _74 => _74.replace, 'call', _75 => _75(/^\//, "")]);
3150
+ const from = _optionalChain([record, 'access', _83 => _83.value, 'access', _84 => _84.from, 'optionalAccess', _85 => _85.replace, 'call', _86 => _86(/^\//, "")]);
3008
3151
  if (from) {
3009
3152
  candidatePaths.add(_pathe2.default.resolve(configService.absoluteSrcRoot, `${from}.json`));
3010
3153
  }
3011
- const manifestFrom = _optionalChain([manifestCache, 'access', _76 => _76.get, 'call', _77 => _77(name), 'optionalAccess', _78 => _78.replace, 'call', _79 => _79(/^\//, "")]);
3154
+ const manifestFrom = _optionalChain([manifestCache, 'access', _87 => _87.get, 'call', _88 => _88(name), 'optionalAccess', _89 => _89.replace, 'call', _90 => _90(/^\//, "")]);
3012
3155
  if (manifestFrom) {
3013
3156
  candidatePaths.add(_pathe2.default.resolve(configService.absoluteSrcRoot, `${manifestFrom}.json`));
3014
3157
  }
@@ -3019,14 +3162,14 @@ function createAutoImportService(ctx) {
3019
3162
  const raw = _fsextra2.default.readJsonSync(candidate);
3020
3163
  metadata = extractJsonPropMetadata(raw);
3021
3164
  if (metadata.props.size > 0 || metadata.docs.size > 0) {
3022
- _optionalChain([logger_default, 'access', _80 => _80.debug, 'optionalCall', _81 => _81(`[auto-import] loaded metadata for ${name} from ${candidate}`)]);
3165
+ _optionalChain([logger_default, 'access', _91 => _91.debug, 'optionalCall', _92 => _92(`[auto-import] loaded metadata for ${name} from ${candidate}`)]);
3023
3166
  break;
3024
3167
  }
3025
3168
  } catch (e5) {
3026
3169
  }
3027
3170
  }
3028
3171
  }
3029
- _optionalChain([logger_default, 'access', _82 => _82.debug, 'optionalCall', _83 => _83(`[auto-import] metadata for ${name}: props=${metadata.props.size} docs=${metadata.docs.size}`)]);
3172
+ _optionalChain([logger_default, 'access', _93 => _93.debug, 'optionalCall', _94 => _94(`[auto-import] metadata for ${name}: props=${metadata.props.size} docs=${metadata.docs.size}`)]);
3030
3173
  return {
3031
3174
  types: new Map(metadata.props),
3032
3175
  docs: new Map(metadata.docs)
@@ -3263,7 +3406,7 @@ function createAutoImportService(ctx) {
3263
3406
  return;
3264
3407
  }
3265
3408
  const json = await ctx.jsonService.read(jsonPath);
3266
- if (!_optionalChain([json, 'optionalAccess', _84 => _84.component])) {
3409
+ if (!_optionalChain([json, 'optionalAccess', _95 => _95.component])) {
3267
3410
  scheduleManifestWrite(removed);
3268
3411
  scheduleTypedComponentsWrite(removed || removedNames.length > 0);
3269
3412
  scheduleHtmlCustomDataWrite(removed || removedNames.length > 0);
@@ -3341,7 +3484,7 @@ function createAutoImportService(ctx) {
3341
3484
  if (!ctx.configService) {
3342
3485
  throw new Error("configService must be initialized before filtering components");
3343
3486
  }
3344
- const globs = _optionalChain([getAutoImportConfig, 'call', _85 => _85(ctx.configService), 'optionalAccess', _86 => _86.globs]);
3487
+ const globs = _optionalChain([getAutoImportConfig, 'call', _96 => _96(ctx.configService), 'optionalAccess', _97 => _97.globs]);
3345
3488
  if (!globs || globs.length === 0) {
3346
3489
  autoImportState.matcher = void 0;
3347
3490
  autoImportState.matcherKey = "";
@@ -3359,7 +3502,7 @@ function createAutoImportService(ctx) {
3359
3502
  return autoImportState.matcher;
3360
3503
  }
3361
3504
  function resolveWithResolvers(componentName, importerBaseName) {
3362
- const resolvers = _optionalChain([getAutoImportConfig, 'call', _87 => _87(ctx.configService), 'optionalAccess', _88 => _88.resolvers]);
3505
+ const resolvers = _optionalChain([getAutoImportConfig, 'call', _98 => _98(ctx.configService), 'optionalAccess', _99 => _99.resolvers]);
3363
3506
  if (!Array.isArray(resolvers)) {
3364
3507
  return void 0;
3365
3508
  }
@@ -3881,7 +4024,7 @@ function createAutoRoutesService(ctx) {
3881
4024
  state.dirty = true;
3882
4025
  }
3883
4026
  function isEnabled() {
3884
- return _optionalChain([ctx, 'access', _89 => _89.configService, 'optionalAccess', _90 => _90.weappViteConfig, 'optionalAccess', _91 => _91.autoRoutes]) === true;
4027
+ return _optionalChain([ctx, 'access', _100 => _100.configService, 'optionalAccess', _101 => _101.weappViteConfig, 'optionalAccess', _102 => _102.autoRoutes]) === true;
3885
4028
  }
3886
4029
  function resetState() {
3887
4030
  updateRoutesReference(state.routes, emptySnapshot);
@@ -6318,7 +6461,7 @@ var AST = class _AST {
6318
6461
  const ret = this.type === null ? this.#parts.slice().map((p) => typeof p === "string" ? p : p.toJSON()) : [this.type, ...this.#parts.map((p) => p.toJSON())];
6319
6462
  if (this.isStart() && !this.type)
6320
6463
  ret.unshift([]);
6321
- if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && _optionalChain([this, 'access', _92 => _92.#parent, 'optionalAccess', _93 => _93.type]) === "!")) {
6464
+ if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && _optionalChain([this, 'access', _103 => _103.#parent, 'optionalAccess', _104 => _104.type]) === "!")) {
6322
6465
  ret.push({});
6323
6466
  }
6324
6467
  return ret;
@@ -6326,7 +6469,7 @@ var AST = class _AST {
6326
6469
  isStart() {
6327
6470
  if (this.#root === this)
6328
6471
  return true;
6329
- if (!_optionalChain([this, 'access', _94 => _94.#parent, 'optionalAccess', _95 => _95.isStart, 'call', _96 => _96()]))
6472
+ if (!_optionalChain([this, 'access', _105 => _105.#parent, 'optionalAccess', _106 => _106.isStart, 'call', _107 => _107()]))
6330
6473
  return false;
6331
6474
  if (this.#parentIndex === 0)
6332
6475
  return true;
@@ -6342,12 +6485,12 @@ var AST = class _AST {
6342
6485
  isEnd() {
6343
6486
  if (this.#root === this)
6344
6487
  return true;
6345
- if (_optionalChain([this, 'access', _97 => _97.#parent, 'optionalAccess', _98 => _98.type]) === "!")
6488
+ if (_optionalChain([this, 'access', _108 => _108.#parent, 'optionalAccess', _109 => _109.type]) === "!")
6346
6489
  return true;
6347
- if (!_optionalChain([this, 'access', _99 => _99.#parent, 'optionalAccess', _100 => _100.isEnd, 'call', _101 => _101()]))
6490
+ if (!_optionalChain([this, 'access', _110 => _110.#parent, 'optionalAccess', _111 => _111.isEnd, 'call', _112 => _112()]))
6348
6491
  return false;
6349
6492
  if (!this.type)
6350
- return _optionalChain([this, 'access', _102 => _102.#parent, 'optionalAccess', _103 => _103.isEnd, 'call', _104 => _104()]);
6493
+ return _optionalChain([this, 'access', _113 => _113.#parent, 'optionalAccess', _114 => _114.isEnd, 'call', _115 => _115()]);
6351
6494
  const pl2 = this.#parent ? this.#parent.#parts.length : 0;
6352
6495
  return this.#parentIndex === pl2 - 1;
6353
6496
  }
@@ -6592,7 +6735,7 @@ var AST = class _AST {
6592
6735
  }
6593
6736
  }
6594
6737
  let end = "";
6595
- if (this.isEnd() && this.#root.#filledNegs && _optionalChain([this, 'access', _105 => _105.#parent, 'optionalAccess', _106 => _106.type]) === "!") {
6738
+ if (this.isEnd() && this.#root.#filledNegs && _optionalChain([this, 'access', _116 => _116.#parent, 'optionalAccess', _117 => _117.type]) === "!") {
6596
6739
  end = "(?:$|\\/)";
6597
6740
  }
6598
6741
  const final2 = start2 + src + end;
@@ -7659,8 +7802,8 @@ var Minipass = (_class5 = class extends _events2.EventEmitter {
7659
7802
  // drop everything and get out of the flow completely
7660
7803
  [ABORT]() {
7661
7804
  this[ABORTED] = true;
7662
- this.emit("abort", _optionalChain([this, 'access', _107 => _107[SIGNAL], 'optionalAccess', _108 => _108.reason]));
7663
- this.destroy(_optionalChain([this, 'access', _109 => _109[SIGNAL], 'optionalAccess', _110 => _110.reason]));
7805
+ this.emit("abort", _optionalChain([this, 'access', _118 => _118[SIGNAL], 'optionalAccess', _119 => _119.reason]));
7806
+ this.destroy(_optionalChain([this, 'access', _120 => _120[SIGNAL], 'optionalAccess', _121 => _121.reason]));
7664
7807
  }
7665
7808
  /**
7666
7809
  * True if the stream has been aborted.
@@ -7720,7 +7863,7 @@ var Minipass = (_class5 = class extends _events2.EventEmitter {
7720
7863
  return this[FLOWING];
7721
7864
  }
7722
7865
  if (typeof chunk === "string" && // unless it is a string already ready for us to use
7723
- !(encoding === this[ENCODING] && !_optionalChain([this, 'access', _111 => _111[DECODER], 'optionalAccess', _112 => _112.lastNeed]))) {
7866
+ !(encoding === this[ENCODING] && !_optionalChain([this, 'access', _122 => _122[DECODER], 'optionalAccess', _123 => _123.lastNeed]))) {
7724
7867
  chunk = Buffer.from(chunk, encoding);
7725
7868
  }
7726
7869
  if (Buffer.isBuffer(chunk) && this[ENCODING]) {
@@ -8910,7 +9053,7 @@ var PathBase = (_class6 = class {
8910
9053
  }
8911
9054
  try {
8912
9055
  const read2 = await this.#fs.promises.readlink(this.fullpath());
8913
- const linkTarget = await _asyncOptionalChain([(await this.parent.realpath()), 'optionalAccess', async _113 => _113.resolve, 'call', async _114 => _114(read2)]);
9056
+ const linkTarget = await _asyncOptionalChain([(await this.parent.realpath()), 'optionalAccess', async _124 => _124.resolve, 'call', async _125 => _125(read2)]);
8914
9057
  if (linkTarget) {
8915
9058
  return this.#linkTarget = linkTarget;
8916
9059
  }
@@ -8935,7 +9078,7 @@ var PathBase = (_class6 = class {
8935
9078
  }
8936
9079
  try {
8937
9080
  const read2 = this.#fs.readlinkSync(this.fullpath());
8938
- const linkTarget = _optionalChain([this, 'access', _115 => _115.parent, 'access', _116 => _116.realpathSync, 'call', _117 => _117(), 'optionalAccess', _118 => _118.resolve, 'call', _119 => _119(read2)]);
9081
+ const linkTarget = _optionalChain([this, 'access', _126 => _126.parent, 'access', _127 => _127.realpathSync, 'call', _128 => _128(), 'optionalAccess', _129 => _129.resolve, 'call', _130 => _130(read2)]);
8939
9082
  if (linkTarget) {
8940
9083
  return this.#linkTarget = linkTarget;
8941
9084
  }
@@ -9665,7 +9808,7 @@ var PathScurryBase = class {
9665
9808
  entry = this.cwd;
9666
9809
  }
9667
9810
  const e = await entry.readlink();
9668
- return withFileTypes ? e : _optionalChain([e, 'optionalAccess', _120 => _120.fullpath, 'call', _121 => _121()]);
9811
+ return withFileTypes ? e : _optionalChain([e, 'optionalAccess', _131 => _131.fullpath, 'call', _132 => _132()]);
9669
9812
  }
9670
9813
  readlinkSync(entry = this.cwd, { withFileTypes } = {
9671
9814
  withFileTypes: false
@@ -9677,7 +9820,7 @@ var PathScurryBase = class {
9677
9820
  entry = this.cwd;
9678
9821
  }
9679
9822
  const e = entry.readlinkSync();
9680
- return withFileTypes ? e : _optionalChain([e, 'optionalAccess', _122 => _122.fullpath, 'call', _123 => _123()]);
9823
+ return withFileTypes ? e : _optionalChain([e, 'optionalAccess', _133 => _133.fullpath, 'call', _134 => _134()]);
9681
9824
  }
9682
9825
  async realpath(entry = this.cwd, { withFileTypes } = {
9683
9826
  withFileTypes: false
@@ -9689,7 +9832,7 @@ var PathScurryBase = class {
9689
9832
  entry = this.cwd;
9690
9833
  }
9691
9834
  const e = await entry.realpath();
9692
- return withFileTypes ? e : _optionalChain([e, 'optionalAccess', _124 => _124.fullpath, 'call', _125 => _125()]);
9835
+ return withFileTypes ? e : _optionalChain([e, 'optionalAccess', _135 => _135.fullpath, 'call', _136 => _136()]);
9693
9836
  }
9694
9837
  realpathSync(entry = this.cwd, { withFileTypes } = {
9695
9838
  withFileTypes: false
@@ -9701,7 +9844,7 @@ var PathScurryBase = class {
9701
9844
  entry = this.cwd;
9702
9845
  }
9703
9846
  const e = entry.realpathSync();
9704
- return withFileTypes ? e : _optionalChain([e, 'optionalAccess', _126 => _126.fullpath, 'call', _127 => _127()]);
9847
+ return withFileTypes ? e : _optionalChain([e, 'optionalAccess', _137 => _137.fullpath, 'call', _138 => _138()]);
9705
9848
  }
9706
9849
  async walk(entry = this.cwd, opts = {}) {
9707
9850
  if (typeof entry === "string") {
@@ -9735,7 +9878,7 @@ var PathScurryBase = class {
9735
9878
  results.push(withFileTypes ? e : e.fullpath());
9736
9879
  }
9737
9880
  if (follow && e.isSymbolicLink()) {
9738
- e.realpath().then((r2) => _optionalChain([r2, 'optionalAccess', _128 => _128.isUnknown, 'call', _129 => _129()]) ? r2.lstat() : r2).then((r2) => _optionalChain([r2, 'optionalAccess', _130 => _130.shouldWalk, 'call', _131 => _131(dirs, walkFilter)]) ? walk2(r2, next) : next());
9881
+ e.realpath().then((r2) => _optionalChain([r2, 'optionalAccess', _139 => _139.isUnknown, 'call', _140 => _140()]) ? r2.lstat() : r2).then((r2) => _optionalChain([r2, 'optionalAccess', _141 => _141.shouldWalk, 'call', _142 => _142(dirs, walkFilter)]) ? walk2(r2, next) : next());
9739
9882
  } else {
9740
9883
  if (e.shouldWalk(dirs, walkFilter)) {
9741
9884
  walk2(e, next);
@@ -9881,7 +10024,7 @@ var PathScurryBase = class {
9881
10024
  const promises3 = [];
9882
10025
  for (const e of entries) {
9883
10026
  if (e.isSymbolicLink()) {
9884
- promises3.push(e.realpath().then((r2) => _optionalChain([r2, 'optionalAccess', _132 => _132.isUnknown, 'call', _133 => _133()]) ? r2.lstat() : r2));
10027
+ promises3.push(e.realpath().then((r2) => _optionalChain([r2, 'optionalAccess', _143 => _143.isUnknown, 'call', _144 => _144()]) ? r2.lstat() : r2));
9885
10028
  }
9886
10029
  }
9887
10030
  if (promises3.length) {
@@ -10315,7 +10458,7 @@ var HasWalkedCache = class _HasWalkedCache {
10315
10458
  return new _HasWalkedCache(new Map(this.store));
10316
10459
  }
10317
10460
  hasWalked(target, pattern) {
10318
- return _optionalChain([this, 'access', _134 => _134.store, 'access', _135 => _135.get, 'call', _136 => _136(target.fullpath()), 'optionalAccess', _137 => _137.has, 'call', _138 => _138(pattern.globString())]);
10461
+ return _optionalChain([this, 'access', _145 => _145.store, 'access', _146 => _146.get, 'call', _147 => _147(target.fullpath()), 'optionalAccess', _148 => _148.has, 'call', _149 => _149(pattern.globString())]);
10319
10462
  }
10320
10463
  storeWalked(target, pattern) {
10321
10464
  const fullpath = target.fullpath();
@@ -10427,8 +10570,8 @@ var Processor = (_class13 = class _Processor {
10427
10570
  if (!t2.isSymbolicLink() || this.follow || pattern.checkFollowGlobstar()) {
10428
10571
  this.subwalks.add(t2, pattern);
10429
10572
  }
10430
- const rp = _optionalChain([rest, 'optionalAccess', _139 => _139.pattern, 'call', _140 => _140()]);
10431
- const rrest = _optionalChain([rest, 'optionalAccess', _141 => _141.rest, 'call', _142 => _142()]);
10573
+ const rp = _optionalChain([rest, 'optionalAccess', _150 => _150.pattern, 'call', _151 => _151()]);
10574
+ const rrest = _optionalChain([rest, 'optionalAccess', _152 => _152.rest, 'call', _153 => _153()]);
10432
10575
  if (!rest || (rp === "" || rp === ".") && !rrest) {
10433
10576
  this.matches.add(t2, absolute, rp === "" || rp === ".");
10434
10577
  } else {
@@ -10563,17 +10706,17 @@ var GlobUtil = (_class14 = class {
10563
10706
  }
10564
10707
  }
10565
10708
  #ignored(path36) {
10566
- return this.seen.has(path36) || !!_optionalChain([this, 'access', _143 => _143.#ignore, 'optionalAccess', _144 => _144.ignored, 'optionalCall', _145 => _145(path36)]);
10709
+ return this.seen.has(path36) || !!_optionalChain([this, 'access', _154 => _154.#ignore, 'optionalAccess', _155 => _155.ignored, 'optionalCall', _156 => _156(path36)]);
10567
10710
  }
10568
10711
  #childrenIgnored(path36) {
10569
- return !!_optionalChain([this, 'access', _146 => _146.#ignore, 'optionalAccess', _147 => _147.childrenIgnored, 'optionalCall', _148 => _148(path36)]);
10712
+ return !!_optionalChain([this, 'access', _157 => _157.#ignore, 'optionalAccess', _158 => _158.childrenIgnored, 'optionalCall', _159 => _159(path36)]);
10570
10713
  }
10571
10714
  // backpressure mechanism
10572
10715
  pause() {
10573
10716
  this.paused = true;
10574
10717
  }
10575
10718
  resume() {
10576
- if (_optionalChain([this, 'access', _149 => _149.signal, 'optionalAccess', _150 => _150.aborted]))
10719
+ if (_optionalChain([this, 'access', _160 => _160.signal, 'optionalAccess', _161 => _161.aborted]))
10577
10720
  return;
10578
10721
  this.paused = false;
10579
10722
  let fn = void 0;
@@ -10582,7 +10725,7 @@ var GlobUtil = (_class14 = class {
10582
10725
  }
10583
10726
  }
10584
10727
  onResume(fn) {
10585
- if (_optionalChain([this, 'access', _151 => _151.signal, 'optionalAccess', _152 => _152.aborted]))
10728
+ if (_optionalChain([this, 'access', _162 => _162.signal, 'optionalAccess', _163 => _163.aborted]))
10586
10729
  return;
10587
10730
  if (!this.paused) {
10588
10731
  fn();
@@ -10604,7 +10747,7 @@ var GlobUtil = (_class14 = class {
10604
10747
  }
10605
10748
  const needStat = e.isUnknown() || this.opts.stat;
10606
10749
  const s = needStat ? await e.lstat() : e;
10607
- if (this.opts.follow && this.opts.nodir && _optionalChain([s, 'optionalAccess', _153 => _153.isSymbolicLink, 'call', _154 => _154()])) {
10750
+ if (this.opts.follow && this.opts.nodir && _optionalChain([s, 'optionalAccess', _164 => _164.isSymbolicLink, 'call', _165 => _165()])) {
10608
10751
  const target = await s.realpath();
10609
10752
  if (target && (target.isUnknown() || this.opts.stat)) {
10610
10753
  await target.lstat();
@@ -10613,7 +10756,7 @@ var GlobUtil = (_class14 = class {
10613
10756
  return this.matchCheckTest(s, ifDir);
10614
10757
  }
10615
10758
  matchCheckTest(e, ifDir) {
10616
- return e && (this.maxDepth === Infinity || e.depth() <= this.maxDepth) && (!ifDir || e.canReaddir()) && (!this.opts.nodir || !e.isDirectory()) && (!this.opts.nodir || !this.opts.follow || !e.isSymbolicLink() || !_optionalChain([e, 'access', _155 => _155.realpathCached, 'call', _156 => _156(), 'optionalAccess', _157 => _157.isDirectory, 'call', _158 => _158()])) && !this.#ignored(e) ? e : void 0;
10759
+ return e && (this.maxDepth === Infinity || e.depth() <= this.maxDepth) && (!ifDir || e.canReaddir()) && (!this.opts.nodir || !e.isDirectory()) && (!this.opts.nodir || !this.opts.follow || !e.isSymbolicLink() || !_optionalChain([e, 'access', _166 => _166.realpathCached, 'call', _167 => _167(), 'optionalAccess', _168 => _168.isDirectory, 'call', _169 => _169()])) && !this.#ignored(e) ? e : void 0;
10617
10760
  }
10618
10761
  matchCheckSync(e, ifDir) {
10619
10762
  if (ifDir && this.opts.nodir)
@@ -10627,9 +10770,9 @@ var GlobUtil = (_class14 = class {
10627
10770
  }
10628
10771
  const needStat = e.isUnknown() || this.opts.stat;
10629
10772
  const s = needStat ? e.lstatSync() : e;
10630
- if (this.opts.follow && this.opts.nodir && _optionalChain([s, 'optionalAccess', _159 => _159.isSymbolicLink, 'call', _160 => _160()])) {
10773
+ if (this.opts.follow && this.opts.nodir && _optionalChain([s, 'optionalAccess', _170 => _170.isSymbolicLink, 'call', _171 => _171()])) {
10631
10774
  const target = s.realpathSync();
10632
- if (target && (_optionalChain([target, 'optionalAccess', _161 => _161.isUnknown, 'call', _162 => _162()]) || this.opts.stat)) {
10775
+ if (target && (_optionalChain([target, 'optionalAccess', _172 => _172.isUnknown, 'call', _173 => _173()]) || this.opts.stat)) {
10633
10776
  target.lstatSync();
10634
10777
  }
10635
10778
  }
@@ -10638,7 +10781,7 @@ var GlobUtil = (_class14 = class {
10638
10781
  matchFinish(e, absolute) {
10639
10782
  if (this.#ignored(e))
10640
10783
  return;
10641
- if (!this.includeChildMatches && _optionalChain([this, 'access', _163 => _163.#ignore, 'optionalAccess', _164 => _164.add])) {
10784
+ if (!this.includeChildMatches && _optionalChain([this, 'access', _174 => _174.#ignore, 'optionalAccess', _175 => _175.add])) {
10642
10785
  const ign = `${e.relativePosix()}/**`;
10643
10786
  this.#ignore.add(ign);
10644
10787
  }
@@ -10667,14 +10810,14 @@ var GlobUtil = (_class14 = class {
10667
10810
  this.matchFinish(p, absolute);
10668
10811
  }
10669
10812
  walkCB(target, patterns, cb) {
10670
- if (_optionalChain([this, 'access', _165 => _165.signal, 'optionalAccess', _166 => _166.aborted]))
10813
+ if (_optionalChain([this, 'access', _176 => _176.signal, 'optionalAccess', _177 => _177.aborted]))
10671
10814
  cb();
10672
10815
  this.walkCB2(target, patterns, new Processor(this.opts), cb);
10673
10816
  }
10674
10817
  walkCB2(target, patterns, processor, cb) {
10675
10818
  if (this.#childrenIgnored(target))
10676
10819
  return cb();
10677
- if (_optionalChain([this, 'access', _167 => _167.signal, 'optionalAccess', _168 => _168.aborted]))
10820
+ if (_optionalChain([this, 'access', _178 => _178.signal, 'optionalAccess', _179 => _179.aborted]))
10678
10821
  cb();
10679
10822
  if (this.paused) {
10680
10823
  this.onResume(() => this.walkCB2(target, patterns, processor, cb));
@@ -10726,14 +10869,14 @@ var GlobUtil = (_class14 = class {
10726
10869
  next();
10727
10870
  }
10728
10871
  walkCBSync(target, patterns, cb) {
10729
- if (_optionalChain([this, 'access', _169 => _169.signal, 'optionalAccess', _170 => _170.aborted]))
10872
+ if (_optionalChain([this, 'access', _180 => _180.signal, 'optionalAccess', _181 => _181.aborted]))
10730
10873
  cb();
10731
10874
  this.walkCB2Sync(target, patterns, new Processor(this.opts), cb);
10732
10875
  }
10733
10876
  walkCB2Sync(target, patterns, processor, cb) {
10734
10877
  if (this.#childrenIgnored(target))
10735
10878
  return cb();
10736
- if (_optionalChain([this, 'access', _171 => _171.signal, 'optionalAccess', _172 => _172.aborted]))
10879
+ if (_optionalChain([this, 'access', _182 => _182.signal, 'optionalAccess', _183 => _183.aborted]))
10737
10880
  cb();
10738
10881
  if (this.paused) {
10739
10882
  this.onResume(() => this.walkCB2Sync(target, patterns, processor, cb));
@@ -10788,14 +10931,14 @@ var GlobWalker = (_class15 = class extends GlobUtil {
10788
10931
  this.matches.add(e);
10789
10932
  }
10790
10933
  async walk() {
10791
- if (_optionalChain([this, 'access', _173 => _173.signal, 'optionalAccess', _174 => _174.aborted]))
10934
+ if (_optionalChain([this, 'access', _184 => _184.signal, 'optionalAccess', _185 => _185.aborted]))
10792
10935
  throw this.signal.reason;
10793
10936
  if (this.path.isUnknown()) {
10794
10937
  await this.path.lstat();
10795
10938
  }
10796
10939
  await new Promise((res, rej) => {
10797
10940
  this.walkCB(this.path, this.patterns, () => {
10798
- if (_optionalChain([this, 'access', _175 => _175.signal, 'optionalAccess', _176 => _176.aborted])) {
10941
+ if (_optionalChain([this, 'access', _186 => _186.signal, 'optionalAccess', _187 => _187.aborted])) {
10799
10942
  rej(this.signal.reason);
10800
10943
  } else {
10801
10944
  res(this.matches);
@@ -10805,13 +10948,13 @@ var GlobWalker = (_class15 = class extends GlobUtil {
10805
10948
  return this.matches;
10806
10949
  }
10807
10950
  walkSync() {
10808
- if (_optionalChain([this, 'access', _177 => _177.signal, 'optionalAccess', _178 => _178.aborted]))
10951
+ if (_optionalChain([this, 'access', _188 => _188.signal, 'optionalAccess', _189 => _189.aborted]))
10809
10952
  throw this.signal.reason;
10810
10953
  if (this.path.isUnknown()) {
10811
10954
  this.path.lstatSync();
10812
10955
  }
10813
10956
  this.walkCBSync(this.path, this.patterns, () => {
10814
- if (_optionalChain([this, 'access', _179 => _179.signal, 'optionalAccess', _180 => _180.aborted]))
10957
+ if (_optionalChain([this, 'access', _190 => _190.signal, 'optionalAccess', _191 => _191.aborted]))
10815
10958
  throw this.signal.reason;
10816
10959
  });
10817
10960
  return this.matches;
@@ -11262,15 +11405,15 @@ var ignoreENOENTSync = (fn, rethrow) => {
11262
11405
  // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/rimraf-posix.js
11263
11406
  var { lstat: lstat4, rmdir, unlink } = promises;
11264
11407
  var rimrafPosix = async (path36, opt) => {
11265
- _optionalChain([opt, 'optionalAccess', _181 => _181.signal, 'optionalAccess', _182 => _182.throwIfAborted, 'call', _183 => _183()]);
11408
+ _optionalChain([opt, 'optionalAccess', _192 => _192.signal, 'optionalAccess', _193 => _193.throwIfAborted, 'call', _194 => _194()]);
11266
11409
  return await _asyncNullishCoalesce(await ignoreENOENT(lstat4(path36).then((stat5) => rimrafPosixDir(path36, opt, stat5))), async () => ( true));
11267
11410
  };
11268
11411
  var rimrafPosixSync = (path36, opt) => {
11269
- _optionalChain([opt, 'optionalAccess', _184 => _184.signal, 'optionalAccess', _185 => _185.throwIfAborted, 'call', _186 => _186()]);
11412
+ _optionalChain([opt, 'optionalAccess', _195 => _195.signal, 'optionalAccess', _196 => _196.throwIfAborted, 'call', _197 => _197()]);
11270
11413
  return _nullishCoalesce(ignoreENOENTSync(() => rimrafPosixDirSync(path36, opt, _fs.lstatSync.call(void 0, path36))), () => ( true));
11271
11414
  };
11272
11415
  var rimrafPosixDir = async (path36, opt, ent) => {
11273
- _optionalChain([opt, 'optionalAccess', _187 => _187.signal, 'optionalAccess', _188 => _188.throwIfAborted, 'call', _189 => _189()]);
11416
+ _optionalChain([opt, 'optionalAccess', _198 => _198.signal, 'optionalAccess', _199 => _199.throwIfAborted, 'call', _200 => _200()]);
11274
11417
  const entries = ent.isDirectory() ? await readdirOrError(path36) : null;
11275
11418
  if (!Array.isArray(entries)) {
11276
11419
  if (entries) {
@@ -11301,7 +11444,7 @@ var rimrafPosixDir = async (path36, opt, ent) => {
11301
11444
  return true;
11302
11445
  };
11303
11446
  var rimrafPosixDirSync = (path36, opt, ent) => {
11304
- _optionalChain([opt, 'optionalAccess', _190 => _190.signal, 'optionalAccess', _191 => _191.throwIfAborted, 'call', _192 => _192()]);
11447
+ _optionalChain([opt, 'optionalAccess', _201 => _201.signal, 'optionalAccess', _202 => _202.throwIfAborted, 'call', _203 => _203()]);
11305
11448
  const entries = ent.isDirectory() ? readdirOrErrorSync(path36) : null;
11306
11449
  if (!Array.isArray(entries)) {
11307
11450
  if (entries) {
@@ -11478,11 +11621,11 @@ var uniqueFilename = (path36) => `.${_path.basename.call(void 0, path36)}.${Math
11478
11621
  var unlinkFixEPERM = fixEPERM(unlink2);
11479
11622
  var unlinkFixEPERMSync = fixEPERMSync(_fs.unlinkSync);
11480
11623
  var rimrafMoveRemove = async (path36, opt) => {
11481
- _optionalChain([opt, 'optionalAccess', _193 => _193.signal, 'optionalAccess', _194 => _194.throwIfAborted, 'call', _195 => _195()]);
11624
+ _optionalChain([opt, 'optionalAccess', _204 => _204.signal, 'optionalAccess', _205 => _205.throwIfAborted, 'call', _206 => _206()]);
11482
11625
  return await _asyncNullishCoalesce(await ignoreENOENT(lstat5(path36).then((stat5) => rimrafMoveRemoveDir(path36, opt, stat5))), async () => ( true));
11483
11626
  };
11484
11627
  var rimrafMoveRemoveDir = async (path36, opt, ent) => {
11485
- _optionalChain([opt, 'optionalAccess', _196 => _196.signal, 'optionalAccess', _197 => _197.throwIfAborted, 'call', _198 => _198()]);
11628
+ _optionalChain([opt, 'optionalAccess', _207 => _207.signal, 'optionalAccess', _208 => _208.throwIfAborted, 'call', _209 => _209()]);
11486
11629
  if (!opt.tmp) {
11487
11630
  return rimrafMoveRemoveDir(path36, { ...opt, tmp: await defaultTmp(path36) }, ent);
11488
11631
  }
@@ -11524,11 +11667,11 @@ var tmpUnlink = async (path36, tmp, rm2) => {
11524
11667
  return await rm2(tmpFile);
11525
11668
  };
11526
11669
  var rimrafMoveRemoveSync = (path36, opt) => {
11527
- _optionalChain([opt, 'optionalAccess', _199 => _199.signal, 'optionalAccess', _200 => _200.throwIfAborted, 'call', _201 => _201()]);
11670
+ _optionalChain([opt, 'optionalAccess', _210 => _210.signal, 'optionalAccess', _211 => _211.throwIfAborted, 'call', _212 => _212()]);
11528
11671
  return _nullishCoalesce(ignoreENOENTSync(() => rimrafMoveRemoveDirSync(path36, opt, _fs.lstatSync.call(void 0, path36))), () => ( true));
11529
11672
  };
11530
11673
  var rimrafMoveRemoveDirSync = (path36, opt, ent) => {
11531
- _optionalChain([opt, 'optionalAccess', _202 => _202.signal, 'optionalAccess', _203 => _203.throwIfAborted, 'call', _204 => _204()]);
11674
+ _optionalChain([opt, 'optionalAccess', _213 => _213.signal, 'optionalAccess', _214 => _214.throwIfAborted, 'call', _215 => _215()]);
11532
11675
  if (!opt.tmp) {
11533
11676
  return rimrafMoveRemoveDirSync(path36, { ...opt, tmp: defaultTmpSync(path36) }, ent);
11534
11677
  }
@@ -11582,7 +11725,7 @@ var rimrafWindowsFileSync = retryBusySync(fixEPERMSync(_fs.unlinkSync));
11582
11725
  var rimrafWindowsDirRetry = retryBusy(fixEPERM(rmdir3));
11583
11726
  var rimrafWindowsDirRetrySync = retryBusySync(fixEPERMSync(_fs.rmdirSync));
11584
11727
  var rimrafWindowsDirMoveRemoveFallback = async (path36, { filter: filter3, ...opt }) => {
11585
- _optionalChain([opt, 'optionalAccess', _205 => _205.signal, 'optionalAccess', _206 => _206.throwIfAborted, 'call', _207 => _207()]);
11728
+ _optionalChain([opt, 'optionalAccess', _216 => _216.signal, 'optionalAccess', _217 => _217.throwIfAborted, 'call', _218 => _218()]);
11586
11729
  try {
11587
11730
  await rimrafWindowsDirRetry(path36, opt);
11588
11731
  return true;
@@ -11594,7 +11737,7 @@ var rimrafWindowsDirMoveRemoveFallback = async (path36, { filter: filter3, ...op
11594
11737
  }
11595
11738
  };
11596
11739
  var rimrafWindowsDirMoveRemoveFallbackSync = (path36, { filter: filter3, ...opt }) => {
11597
- _optionalChain([opt, 'optionalAccess', _208 => _208.signal, 'optionalAccess', _209 => _209.throwIfAborted, 'call', _210 => _210()]);
11740
+ _optionalChain([opt, 'optionalAccess', _219 => _219.signal, 'optionalAccess', _220 => _220.throwIfAborted, 'call', _221 => _221()]);
11598
11741
  try {
11599
11742
  rimrafWindowsDirRetrySync(path36, opt);
11600
11743
  return true;
@@ -11609,15 +11752,15 @@ var START = Symbol("start");
11609
11752
  var CHILD = Symbol("child");
11610
11753
  var FINISH = Symbol("finish");
11611
11754
  var rimrafWindows = async (path36, opt) => {
11612
- _optionalChain([opt, 'optionalAccess', _211 => _211.signal, 'optionalAccess', _212 => _212.throwIfAborted, 'call', _213 => _213()]);
11755
+ _optionalChain([opt, 'optionalAccess', _222 => _222.signal, 'optionalAccess', _223 => _223.throwIfAborted, 'call', _224 => _224()]);
11613
11756
  return await _asyncNullishCoalesce(await ignoreENOENT(lstat6(path36).then((stat5) => rimrafWindowsDir(path36, opt, stat5, START))), async () => ( true));
11614
11757
  };
11615
11758
  var rimrafWindowsSync = (path36, opt) => {
11616
- _optionalChain([opt, 'optionalAccess', _214 => _214.signal, 'optionalAccess', _215 => _215.throwIfAborted, 'call', _216 => _216()]);
11759
+ _optionalChain([opt, 'optionalAccess', _225 => _225.signal, 'optionalAccess', _226 => _226.throwIfAborted, 'call', _227 => _227()]);
11617
11760
  return _nullishCoalesce(ignoreENOENTSync(() => rimrafWindowsDirSync(path36, opt, _fs.lstatSync.call(void 0, path36), START)), () => ( true));
11618
11761
  };
11619
11762
  var rimrafWindowsDir = async (path36, opt, ent, state = START) => {
11620
- _optionalChain([opt, 'optionalAccess', _217 => _217.signal, 'optionalAccess', _218 => _218.throwIfAborted, 'call', _219 => _219()]);
11763
+ _optionalChain([opt, 'optionalAccess', _228 => _228.signal, 'optionalAccess', _229 => _229.throwIfAborted, 'call', _230 => _230()]);
11621
11764
  const entries = ent.isDirectory() ? await readdirOrError(path36) : null;
11622
11765
  if (!Array.isArray(entries)) {
11623
11766
  if (entries) {
@@ -11720,8 +11863,8 @@ var rimrafNativeSync = (path36, opt) => {
11720
11863
  _chunkQKFYCWOCcjs.init_cjs_shims.call(void 0, );
11721
11864
  var [major = 0, minor = 0] = process.version.replace(/^v/, "").split(".").map((v) => parseInt(v, 10));
11722
11865
  var hasNative = major > 14 || major === 14 && minor >= 14;
11723
- var useNative = !hasNative || process.platform === "win32" ? () => false : (opt) => !_optionalChain([opt, 'optionalAccess', _220 => _220.signal]) && !_optionalChain([opt, 'optionalAccess', _221 => _221.filter]);
11724
- var useNativeSync = !hasNative || process.platform === "win32" ? () => false : (opt) => !_optionalChain([opt, 'optionalAccess', _222 => _222.signal]) && !_optionalChain([opt, 'optionalAccess', _223 => _223.filter]);
11866
+ var useNative = !hasNative || process.platform === "win32" ? () => false : (opt) => !_optionalChain([opt, 'optionalAccess', _231 => _231.signal]) && !_optionalChain([opt, 'optionalAccess', _232 => _232.filter]);
11867
+ var useNativeSync = !hasNative || process.platform === "win32" ? () => false : (opt) => !_optionalChain([opt, 'optionalAccess', _233 => _233.signal]) && !_optionalChain([opt, 'optionalAccess', _234 => _234.filter]);
11725
11868
 
11726
11869
  // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/index.js
11727
11870
  var wrap = (fn) => async (path36, opt) => {
@@ -11968,7 +12111,7 @@ function resolveSharedChunkName(options) {
11968
12111
  const subPackageRootList = Array.from(subPackageRoots);
11969
12112
  const moduleInfo = ctx.getModuleInfo(id);
11970
12113
  const takeImporters = getTakeImporters(id);
11971
- if (_optionalChain([takeImporters, 'optionalAccess', _224 => _224.size])) {
12114
+ if (_optionalChain([takeImporters, 'optionalAccess', _235 => _235.size])) {
11972
12115
  const takeSharedName = resolveTakeSharedChunkName({
11973
12116
  id,
11974
12117
  ctx,
@@ -11991,17 +12134,17 @@ function resolveSharedChunkName(options) {
11991
12134
  subPackageRoots: subPackageRootList,
11992
12135
  moduleId: id
11993
12136
  });
11994
- if (!_optionalChain([moduleInfo, 'optionalAccess', _225 => _225.importers]) || moduleInfo.importers.length <= 1) {
12137
+ if (!_optionalChain([moduleInfo, 'optionalAccess', _236 => _236.importers]) || moduleInfo.importers.length <= 1) {
11995
12138
  return void 0;
11996
12139
  }
11997
12140
  return _pathe.posix.join(moduleRoot, "common");
11998
12141
  }
11999
- if (!_optionalChain([moduleInfo, 'optionalAccess', _226 => _226.importers]) || moduleInfo.importers.length <= 1) {
12142
+ if (!_optionalChain([moduleInfo, 'optionalAccess', _237 => _237.importers]) || moduleInfo.importers.length <= 1) {
12000
12143
  return void 0;
12001
12144
  }
12002
12145
  return "common";
12003
12146
  }
12004
- if (!_optionalChain([moduleInfo, 'optionalAccess', _227 => _227.importers]) || moduleInfo.importers.length <= 1) {
12147
+ if (!_optionalChain([moduleInfo, 'optionalAccess', _238 => _238.importers]) || moduleInfo.importers.length <= 1) {
12005
12148
  return void 0;
12006
12149
  }
12007
12150
  const { summary, ignoredMainImporters } = summarizeImportPrefixes({
@@ -12107,8 +12250,8 @@ function collectEffectivePrefixes(importer, options, state) {
12107
12250
  };
12108
12251
  }
12109
12252
  const moduleInfo = ctx.getModuleInfo(importer);
12110
- const importerParents = _nullishCoalesce(_optionalChain([moduleInfo, 'optionalAccess', _228 => _228.importers]), () => ( []));
12111
- const forcedDuplicate = _nullishCoalesce(_optionalChain([forceDuplicateTester, 'optionalCall', _229 => _229(relativeId, importer)]), () => ( false));
12253
+ const importerParents = _nullishCoalesce(_optionalChain([moduleInfo, 'optionalAccess', _239 => _239.importers]), () => ( []));
12254
+ const forcedDuplicate = _nullishCoalesce(_optionalChain([forceDuplicateTester, 'optionalCall', _240 => _240(relativeId, importer)]), () => ( false));
12112
12255
  if (!importerParents.length) {
12113
12256
  const result2 = forcedDuplicate ? {
12114
12257
  prefixes: [],
@@ -12210,7 +12353,7 @@ function assertModuleScopedToRoot(options) {
12210
12353
  subPackageRoots,
12211
12354
  moduleId
12212
12355
  } = options;
12213
- if (!moduleRoot || !_optionalChain([moduleInfo, 'optionalAccess', _230 => _230.importers, 'optionalAccess', _231 => _231.length])) {
12356
+ if (!moduleRoot || !_optionalChain([moduleInfo, 'optionalAccess', _241 => _241.importers, 'optionalAccess', _242 => _242.length])) {
12214
12357
  return;
12215
12358
  }
12216
12359
  for (const importer of moduleInfo.importers) {
@@ -12247,7 +12390,7 @@ function applySharedChunkStrategy(bundle, options) {
12247
12390
  }
12248
12391
  const sourceMapKeys = collectSourceMapKeys(fileName, chunk);
12249
12392
  const sourceMapAssetInfo = findSourceMapAsset(bundle, sourceMapKeys);
12250
- const resolvedSourceMap = resolveSourceMapSource(originalMap, _optionalChain([sourceMapAssetInfo, 'optionalAccess', _232 => _232.asset, 'access', _233 => _233.source]));
12393
+ const resolvedSourceMap = resolveSourceMapSource(originalMap, _optionalChain([sourceMapAssetInfo, 'optionalAccess', _243 => _243.asset, 'access', _244 => _244.source]));
12251
12394
  const importerMap = /* @__PURE__ */ new Map();
12252
12395
  let hasMainImporter = false;
12253
12396
  const shouldForceDuplicate = isForceDuplicateSharedChunk(originalSharedFileName);
@@ -12294,7 +12437,7 @@ function applySharedChunkStrategy(bundle, options) {
12294
12437
  }
12295
12438
  finalFileName = newFileName;
12296
12439
  }
12297
- _optionalChain([options, 'access', _234 => _234.onFallback, 'optionalCall', _235 => _235({
12440
+ _optionalChain([options, 'access', _245 => _245.onFallback, 'optionalCall', _246 => _246({
12298
12441
  sharedFileName: originalSharedFileName,
12299
12442
  finalFileName,
12300
12443
  reason: hasMainImporter ? "main-package" : "no-subpackage",
@@ -12318,7 +12461,7 @@ function applySharedChunkStrategy(bundle, options) {
12318
12461
  delete bundle[mapKey];
12319
12462
  }
12320
12463
  }
12321
- _optionalChain([options, 'access', _236 => _236.onFallback, 'optionalCall', _237 => _237({
12464
+ _optionalChain([options, 'access', _247 => _247.onFallback, 'optionalCall', _248 => _248({
12322
12465
  sharedFileName: originalSharedFileName,
12323
12466
  finalFileName: newFileName,
12324
12467
  reason: "main-package",
@@ -12357,10 +12500,10 @@ function applySharedChunkStrategy(bundle, options) {
12357
12500
  }
12358
12501
  const chunkBytes = typeof originalCode === "string" ? _buffer.Buffer.byteLength(originalCode, "utf8") : void 0;
12359
12502
  const redundantBytes = typeof chunkBytes === "number" ? chunkBytes * Math.max(duplicates.length - 1, 0) : void 0;
12360
- _optionalChain([options, 'access', _238 => _238.onDuplicate, 'optionalCall', _239 => _239({
12503
+ _optionalChain([options, 'access', _249 => _249.onDuplicate, 'optionalCall', _250 => _250({
12361
12504
  sharedFileName: originalSharedFileName,
12362
12505
  duplicates,
12363
- ignoredMainImporters: _optionalChain([diagnostics, 'optionalAccess', _240 => _240.ignoredMainImporters]),
12506
+ ignoredMainImporters: _optionalChain([diagnostics, 'optionalAccess', _251 => _251.ignoredMainImporters]),
12364
12507
  chunkBytes,
12365
12508
  redundantBytes,
12366
12509
  retainedInMain: shouldRetainOriginalChunk
@@ -12385,7 +12528,7 @@ function emitSourceMapAsset(ctx, targetFileName, sourceMapAssetInfo, fallbackSou
12385
12528
  if (!targetFileName) {
12386
12529
  return;
12387
12530
  }
12388
- if (_optionalChain([sourceMapAssetInfo, 'optionalAccess', _241 => _241.asset]) && isSourceLike(sourceMapAssetInfo.asset.source)) {
12531
+ if (_optionalChain([sourceMapAssetInfo, 'optionalAccess', _252 => _252.asset]) && isSourceLike(sourceMapAssetInfo.asset.source)) {
12389
12532
  ctx.emitFile({
12390
12533
  type: "asset",
12391
12534
  fileName: targetFileName,
@@ -12403,12 +12546,12 @@ function emitSourceMapAsset(ctx, targetFileName, sourceMapAssetInfo, fallbackSou
12403
12546
  }
12404
12547
  }
12405
12548
  function isSharedVirtualChunk(fileName, output) {
12406
- return _optionalChain([output, 'optionalAccess', _242 => _242.type]) === "chunk" && fileName.startsWith(`${SHARED_CHUNK_VIRTUAL_PREFIX}/`);
12549
+ return _optionalChain([output, 'optionalAccess', _253 => _253.type]) === "chunk" && fileName.startsWith(`${SHARED_CHUNK_VIRTUAL_PREFIX}/`);
12407
12550
  }
12408
12551
  function findChunkImporters(bundle, target) {
12409
12552
  const importers = /* @__PURE__ */ new Set();
12410
12553
  for (const [fileName, output] of Object.entries(bundle)) {
12411
- if (_optionalChain([output, 'optionalAccess', _243 => _243.type]) !== "chunk") {
12554
+ if (_optionalChain([output, 'optionalAccess', _254 => _254.type]) !== "chunk") {
12412
12555
  continue;
12413
12556
  }
12414
12557
  const chunk = output;
@@ -12598,7 +12741,7 @@ function findSourceMapAsset(bundle, candidateKeys) {
12598
12741
  continue;
12599
12742
  }
12600
12743
  const entry = bundle[key];
12601
- if (_optionalChain([entry, 'optionalAccess', _244 => _244.type]) === "asset") {
12744
+ if (_optionalChain([entry, 'optionalAccess', _255 => _255.type]) === "asset") {
12602
12745
  return {
12603
12746
  asset: entry,
12604
12747
  key
@@ -12703,8 +12846,8 @@ function createForceDuplicateTester(patterns) {
12703
12846
  function createSharedBuildConfig(configService, scanService) {
12704
12847
  const nodeModulesDeps = [REG_NODE_MODULES_DIR];
12705
12848
  const commonjsHelpersDeps = [REG_COMMONJS_HELPERS];
12706
- const sharedStrategy = _nullishCoalesce(_optionalChain([configService, 'access', _245 => _245.weappViteConfig, 'optionalAccess', _246 => _246.chunks, 'optionalAccess', _247 => _247.sharedStrategy]), () => ( DEFAULT_SHARED_CHUNK_STRATEGY));
12707
- const forceDuplicatePatterns = _optionalChain([configService, 'access', _248 => _248.weappViteConfig, 'optionalAccess', _249 => _249.chunks, 'optionalAccess', _250 => _250.forceDuplicatePatterns]);
12849
+ const sharedStrategy = _nullishCoalesce(_optionalChain([configService, 'access', _256 => _256.weappViteConfig, 'optionalAccess', _257 => _257.chunks, 'optionalAccess', _258 => _258.sharedStrategy]), () => ( DEFAULT_SHARED_CHUNK_STRATEGY));
12850
+ const forceDuplicatePatterns = _optionalChain([configService, 'access', _259 => _259.weappViteConfig, 'optionalAccess', _260 => _260.chunks, 'optionalAccess', _261 => _261.forceDuplicatePatterns]);
12708
12851
  const forceDuplicateTester = createForceDuplicateTester(forceDuplicatePatterns);
12709
12852
  const resolveAdvancedChunkName = createAdvancedChunkNameResolver({
12710
12853
  vendorsMatchers: [nodeModulesDeps, commonjsHelpersDeps],
@@ -12798,7 +12941,7 @@ function createBuildService(ctx) {
12798
12941
  function checkWorkersOptions() {
12799
12942
  const workersDir = scanService.workersDir;
12800
12943
  const hasWorkersDir = Boolean(workersDir);
12801
- if (hasWorkersDir && _optionalChain([configService, 'access', _251 => _251.weappViteConfig, 'optionalAccess', _252 => _252.worker, 'optionalAccess', _253 => _253.entry]) === void 0) {
12944
+ if (hasWorkersDir && _optionalChain([configService, 'access', _262 => _262.weappViteConfig, 'optionalAccess', _263 => _263.worker, 'optionalAccess', _264 => _264.entry]) === void 0) {
12802
12945
  logger_default.error("\u68C0\u6D4B\u5230\u5DF2\u7ECF\u5F00\u542F\u4E86 `worker`\uFF0C\u8BF7\u5728 `vite.config.ts` \u4E2D\u8BBE\u7F6E `weapp.worker.entry` \u8DEF\u5F84");
12803
12946
  logger_default.error("\u6BD4\u5982\u5F15\u5165\u7684 `worker` \u8DEF\u5F84\u4E3A `workers/index`, \u6B64\u65F6 `weapp.worker.entry` \u8BBE\u7F6E\u4E3A `[index]` ");
12804
12947
  throw new Error("\u8BF7\u5728 `vite.config.ts` \u4E2D\u8BBE\u7F6E `weapp.worker.entry` \u8DEF\u5F84");
@@ -12823,7 +12966,7 @@ function createBuildService(ctx) {
12823
12966
  if (_process2.default.env.NODE_ENV === void 0) {
12824
12967
  _process2.default.env.NODE_ENV = "development";
12825
12968
  }
12826
- _optionalChain([debug, 'optionalCall', _254 => _254("dev build watcher start")]);
12969
+ _optionalChain([debug, 'optionalCall', _265 => _265("dev build watcher start")]);
12827
12970
  const { hasWorkersDir, workersDir } = checkWorkersOptions();
12828
12971
  const buildOptions = configService.merge(
12829
12972
  void 0,
@@ -12890,8 +13033,8 @@ function createBuildService(ctx) {
12890
13033
  });
12891
13034
  }
12892
13035
  }
12893
- _optionalChain([debug, 'optionalCall', _255 => _255("dev build watcher end")]);
12894
- _optionalChain([debug, 'optionalCall', _256 => _256("dev watcher listen start")]);
13036
+ _optionalChain([debug, 'optionalCall', _266 => _266("dev build watcher end")]);
13037
+ _optionalChain([debug, 'optionalCall', _267 => _267("dev watcher listen start")]);
12895
13038
  let startTime;
12896
13039
  let resolveWatcher;
12897
13040
  let rejectWatcher;
@@ -12914,7 +13057,7 @@ function createBuildService(ctx) {
12914
13057
  return watcher;
12915
13058
  }
12916
13059
  async function runProd() {
12917
- _optionalChain([debug, 'optionalCall', _257 => _257("prod build start")]);
13060
+ _optionalChain([debug, 'optionalCall', _268 => _268("prod build start")]);
12918
13061
  const { hasWorkersDir } = checkWorkersOptions();
12919
13062
  const bundlerPromise = _vite.build.call(void 0,
12920
13063
  configService.merge(
@@ -12924,7 +13067,7 @@ function createBuildService(ctx) {
12924
13067
  );
12925
13068
  const workerPromise = hasWorkersDir ? buildWorkers() : Promise.resolve();
12926
13069
  const [output] = await Promise.all([bundlerPromise, workerPromise]);
12927
- _optionalChain([debug, 'optionalCall', _258 => _258("prod build end")]);
13070
+ _optionalChain([debug, 'optionalCall', _269 => _269("prod build end")]);
12928
13071
  return output;
12929
13072
  }
12930
13073
  async function buildEntry(options) {
@@ -12944,12 +13087,12 @@ function createBuildService(ctx) {
12944
13087
  }
12945
13088
  }
12946
13089
  );
12947
- _optionalChain([debug, 'optionalCall', _259 => _259("deletedFilePaths", deletedFilePaths)]);
13090
+ _optionalChain([debug, 'optionalCall', _270 => _270("deletedFilePaths", deletedFilePaths)]);
12948
13091
  logger_default.success(`\u5DF2\u6E05\u7A7A ${configService.mpDistRoot} \u76EE\u5F55`);
12949
13092
  }
12950
- _optionalChain([debug, 'optionalCall', _260 => _260("build start")]);
13093
+ _optionalChain([debug, 'optionalCall', _271 => _271("build start")]);
12951
13094
  let npmBuildTask = Promise.resolve();
12952
- if (!_optionalChain([options, 'optionalAccess', _261 => _261.skipNpm])) {
13095
+ if (!_optionalChain([options, 'optionalAccess', _272 => _272.skipNpm])) {
12953
13096
  let shouldBuildNpm = true;
12954
13097
  if (configService.isDev) {
12955
13098
  const isDependenciesOutdated = await npmService.checkDependenciesCacheOutdate();
@@ -12976,7 +13119,7 @@ function createBuildService(ctx) {
12976
13119
  result = await runProd();
12977
13120
  }
12978
13121
  await npmBuildTask;
12979
- _optionalChain([debug, 'optionalCall', _262 => _262("build end")]);
13122
+ _optionalChain([debug, 'optionalCall', _273 => _273("build end")]);
12980
13123
  return result;
12981
13124
  }
12982
13125
  return {
@@ -19932,7 +20075,7 @@ function _tryModuleResolve(id, url, conditions) {
19932
20075
  try {
19933
20076
  return moduleResolve(id, url, conditions);
19934
20077
  } catch (error) {
19935
- if (!NOT_FOUND_ERRORS.has(_optionalChain([error, 'optionalAccess', _263 => _263.code]))) {
20078
+ if (!NOT_FOUND_ERRORS.has(_optionalChain([error, 'optionalAccess', _274 => _274.code]))) {
19936
20079
  throw error;
19937
20080
  }
19938
20081
  }
@@ -19961,7 +20104,7 @@ function _resolve(id, options = {}) {
19961
20104
  return pathToFileURL(id);
19962
20105
  }
19963
20106
  } catch (error) {
19964
- if (_optionalChain([error, 'optionalAccess', _264 => _264.code]) !== "ENOENT") {
20107
+ if (_optionalChain([error, 'optionalAccess', _275 => _275.code]) !== "ENOENT") {
19965
20108
  throw error;
19966
20109
  }
19967
20110
  }
@@ -20105,10 +20248,10 @@ function fromGeneratorFn(generatorFn, options) {
20105
20248
  return fromObject({
20106
20249
  name: generatorFn.name,
20107
20250
  async(...args) {
20108
- return iterateAsync(generatorFn.apply(this, args), _optionalChain([options, 'optionalAccess', _265 => _265.onYield]));
20251
+ return iterateAsync(generatorFn.apply(this, args), _optionalChain([options, 'optionalAccess', _276 => _276.onYield]));
20109
20252
  },
20110
20253
  sync(...args) {
20111
- return iterateSync2(generatorFn.apply(this, args), _optionalChain([options, 'optionalAccess', _266 => _266.onYield]));
20254
+ return iterateSync2(generatorFn.apply(this, args), _optionalChain([options, 'optionalAccess', _277 => _277.onYield]));
20112
20255
  }
20113
20256
  });
20114
20257
  }
@@ -20167,7 +20310,7 @@ function findUpSync(name, {
20167
20310
  const filePath = isAbsoluteName ? name : sysPath2.default.join(directory, name);
20168
20311
  try {
20169
20312
  const stats = actualFS.default.statSync(filePath, { throwIfNoEntry: false });
20170
- if (type === "file" && _optionalChain([stats, 'optionalAccess', _267 => _267.isFile, 'call', _268 => _268()]) || type === "directory" && _optionalChain([stats, 'optionalAccess', _269 => _269.isDirectory, 'call', _270 => _270()])) {
20313
+ if (type === "file" && _optionalChain([stats, 'optionalAccess', _278 => _278.isFile, 'call', _279 => _279()]) || type === "directory" && _optionalChain([stats, 'optionalAccess', _280 => _280.isDirectory, 'call', _281 => _281()])) {
20171
20314
  return filePath;
20172
20315
  }
20173
20316
  } catch (e18) {
@@ -20386,18 +20529,18 @@ async function detect(options = {}) {
20386
20529
  }
20387
20530
  }
20388
20531
  }
20389
- if (_optionalChain([stopDir, 'optionalCall', _271 => _271(directory)]))
20532
+ if (_optionalChain([stopDir, 'optionalCall', _282 => _282(directory)]))
20390
20533
  break;
20391
20534
  }
20392
20535
  return null;
20393
20536
  }
20394
20537
  function getNameAndVer(pkg) {
20395
- const handelVer = (version2) => _nullishCoalesce(_optionalChain([version2, 'optionalAccess', _272 => _272.match, 'call', _273 => _273(/\d+(\.\d+){0,2}/), 'optionalAccess', _274 => _274[0]]), () => ( version2));
20538
+ const handelVer = (version2) => _nullishCoalesce(_optionalChain([version2, 'optionalAccess', _283 => _283.match, 'call', _284 => _284(/\d+(\.\d+){0,2}/), 'optionalAccess', _285 => _285[0]]), () => ( version2));
20396
20539
  if (typeof pkg.packageManager === "string") {
20397
20540
  const [name, ver] = pkg.packageManager.replace(/^\^/, "").split("@");
20398
20541
  return { name, ver: handelVer(ver) };
20399
20542
  }
20400
- if (typeof _optionalChain([pkg, 'access', _275 => _275.devEngines, 'optionalAccess', _276 => _276.packageManager, 'optionalAccess', _277 => _277.name]) === "string") {
20543
+ if (typeof _optionalChain([pkg, 'access', _286 => _286.devEngines, 'optionalAccess', _287 => _287.packageManager, 'optionalAccess', _288 => _288.name]) === "string") {
20401
20544
  return {
20402
20545
  name: pkg.devEngines.packageManager.name,
20403
20546
  ver: handelVer(pkg.devEngines.packageManager.version)
@@ -20425,7 +20568,7 @@ async function handlePackageManager(filepath, onUnknown) {
20425
20568
  agent = name;
20426
20569
  return { name, agent, version: version2 };
20427
20570
  } else {
20428
- return _nullishCoalesce(_optionalChain([onUnknown, 'optionalCall', _278 => _278(pkg.packageManager)]), () => ( null));
20571
+ return _nullishCoalesce(_optionalChain([onUnknown, 'optionalCall', _289 => _289(pkg.packageManager)]), () => ( null));
20429
20572
  }
20430
20573
  }
20431
20574
  } catch (e23) {
@@ -20623,7 +20766,7 @@ export default _objectSpread2;`
20623
20766
  function getOxcHelperName(id) {
20624
20767
  OXC_RUNTIME_HELPER_ALIAS.lastIndex = 0;
20625
20768
  const match2 = OXC_RUNTIME_HELPER_ALIAS.exec(id);
20626
- return _optionalChain([match2, 'optionalAccess', _279 => _279[1]]);
20769
+ return _optionalChain([match2, 'optionalAccess', _290 => _290[1]]);
20627
20770
  }
20628
20771
  function createOxcRuntimeSupport() {
20629
20772
  const oxcRuntimeInfo = getPackageInfoSync("@oxc-project/runtime");
@@ -20881,13 +21024,13 @@ function migrateEnhanceOptions(target, options) {
20881
21024
  }
20882
21025
  const enhance = target.enhance;
20883
21026
  const userConfigured = _nullishCoalesce(options.userConfigured, () => ( {}));
20884
- if (!userConfigured.wxml && _optionalChain([enhance, 'optionalAccess', _280 => _280.wxml]) !== void 0) {
21027
+ if (!userConfigured.wxml && _optionalChain([enhance, 'optionalAccess', _291 => _291.wxml]) !== void 0) {
20885
21028
  target.wxml = enhance.wxml;
20886
21029
  }
20887
- if (!userConfigured.wxs && _optionalChain([enhance, 'optionalAccess', _281 => _281.wxs]) !== void 0) {
21030
+ if (!userConfigured.wxs && _optionalChain([enhance, 'optionalAccess', _292 => _292.wxs]) !== void 0) {
20888
21031
  target.wxs = enhance.wxs;
20889
21032
  }
20890
- if (!userConfigured.autoImportComponents && _optionalChain([enhance, 'optionalAccess', _282 => _282.autoImportComponents]) !== void 0) {
21033
+ if (!userConfigured.autoImportComponents && _optionalChain([enhance, 'optionalAccess', _293 => _293.autoImportComponents]) !== void 0) {
20891
21034
  target.autoImportComponents = enhance.autoImportComponents;
20892
21035
  }
20893
21036
  if (options.warn && !hasLoggedEnhanceDeprecation) {
@@ -21052,7 +21195,7 @@ function normalizeSrcDir(root, cwd, srcRoot, config) {
21052
21195
  return _pathe2.default.relative(root, absoluteSrc) || "";
21053
21196
  }
21054
21197
  function normalizeOutDir(root, config) {
21055
- if (!_optionalChain([config, 'optionalAccess', _283 => _283.outDir])) {
21198
+ if (!_optionalChain([config, 'optionalAccess', _294 => _294.outDir])) {
21056
21199
  return _pathe2.default.resolve(root, "dist-web");
21057
21200
  }
21058
21201
  if (_pathe2.default.isAbsolute(config.outDir)) {
@@ -21128,11 +21271,11 @@ function createLoadConfig(options) {
21128
21271
  command: isDev ? "serve" : "build",
21129
21272
  mode
21130
21273
  }, resolvedConfigFile, cwd);
21131
- const loadedConfig = _nullishCoalesce(_optionalChain([loaded, 'optionalAccess', _284 => _284.config]), () => ( {}));
21274
+ const loadedConfig = _nullishCoalesce(_optionalChain([loaded, 'optionalAccess', _295 => _295.config]), () => ( {}));
21132
21275
  let weappLoaded;
21133
21276
  if (weappConfigFilePath) {
21134
21277
  const normalizedWeappPath = _pathe2.default.resolve(weappConfigFilePath);
21135
- const normalizedLoadedPath = _optionalChain([loaded, 'optionalAccess', _285 => _285.path]) ? _pathe2.default.resolve(loaded.path) : void 0;
21278
+ const normalizedLoadedPath = _optionalChain([loaded, 'optionalAccess', _296 => _296.path]) ? _pathe2.default.resolve(loaded.path) : void 0;
21136
21279
  if (normalizedLoadedPath && normalizedLoadedPath === normalizedWeappPath) {
21137
21280
  weappLoaded = loaded;
21138
21281
  } else {
@@ -21165,47 +21308,47 @@ function createLoadConfig(options) {
21165
21308
  weapp: getWeappViteConfig()
21166
21309
  }
21167
21310
  );
21168
- if (_optionalChain([weappLoaded, 'optionalAccess', _286 => _286.config, 'optionalAccess', _287 => _287.weapp])) {
21311
+ if (_optionalChain([weappLoaded, 'optionalAccess', _297 => _297.config, 'optionalAccess', _298 => _298.weapp])) {
21169
21312
  config.weapp = _shared.defu.call(void 0,
21170
21313
  weappLoaded.config.weapp,
21171
21314
  _nullishCoalesce(config.weapp, () => ( {}))
21172
21315
  );
21173
21316
  }
21174
21317
  const shouldWarnEnhance = [
21175
- _optionalChain([inlineConfig, 'optionalAccess', _288 => _288.weapp, 'optionalAccess', _289 => _289.enhance]),
21176
- _optionalChain([loadedConfig, 'access', _290 => _290.weapp, 'optionalAccess', _291 => _291.enhance]),
21177
- _optionalChain([weappLoaded, 'optionalAccess', _292 => _292.config, 'optionalAccess', _293 => _293.weapp, 'optionalAccess', _294 => _294.enhance])
21318
+ _optionalChain([inlineConfig, 'optionalAccess', _299 => _299.weapp, 'optionalAccess', _300 => _300.enhance]),
21319
+ _optionalChain([loadedConfig, 'access', _301 => _301.weapp, 'optionalAccess', _302 => _302.enhance]),
21320
+ _optionalChain([weappLoaded, 'optionalAccess', _303 => _303.config, 'optionalAccess', _304 => _304.weapp, 'optionalAccess', _305 => _305.enhance])
21178
21321
  ].some(hasDeprecatedEnhanceUsage);
21179
21322
  const userConfiguredTopLevel = {
21180
21323
  wxml: [
21181
- _optionalChain([inlineConfig, 'optionalAccess', _295 => _295.weapp, 'optionalAccess', _296 => _296.wxml]),
21182
- _optionalChain([loadedConfig, 'access', _297 => _297.weapp, 'optionalAccess', _298 => _298.wxml]),
21183
- _optionalChain([weappLoaded, 'optionalAccess', _299 => _299.config, 'optionalAccess', _300 => _300.weapp, 'optionalAccess', _301 => _301.wxml])
21324
+ _optionalChain([inlineConfig, 'optionalAccess', _306 => _306.weapp, 'optionalAccess', _307 => _307.wxml]),
21325
+ _optionalChain([loadedConfig, 'access', _308 => _308.weapp, 'optionalAccess', _309 => _309.wxml]),
21326
+ _optionalChain([weappLoaded, 'optionalAccess', _310 => _310.config, 'optionalAccess', _311 => _311.weapp, 'optionalAccess', _312 => _312.wxml])
21184
21327
  ].some((value) => value !== void 0),
21185
21328
  wxs: [
21186
- _optionalChain([inlineConfig, 'optionalAccess', _302 => _302.weapp, 'optionalAccess', _303 => _303.wxs]),
21187
- _optionalChain([loadedConfig, 'access', _304 => _304.weapp, 'optionalAccess', _305 => _305.wxs]),
21188
- _optionalChain([weappLoaded, 'optionalAccess', _306 => _306.config, 'optionalAccess', _307 => _307.weapp, 'optionalAccess', _308 => _308.wxs])
21329
+ _optionalChain([inlineConfig, 'optionalAccess', _313 => _313.weapp, 'optionalAccess', _314 => _314.wxs]),
21330
+ _optionalChain([loadedConfig, 'access', _315 => _315.weapp, 'optionalAccess', _316 => _316.wxs]),
21331
+ _optionalChain([weappLoaded, 'optionalAccess', _317 => _317.config, 'optionalAccess', _318 => _318.weapp, 'optionalAccess', _319 => _319.wxs])
21189
21332
  ].some((value) => value !== void 0),
21190
21333
  autoImportComponents: [
21191
- _optionalChain([inlineConfig, 'optionalAccess', _309 => _309.weapp, 'optionalAccess', _310 => _310.autoImportComponents]),
21192
- _optionalChain([loadedConfig, 'access', _311 => _311.weapp, 'optionalAccess', _312 => _312.autoImportComponents]),
21193
- _optionalChain([weappLoaded, 'optionalAccess', _313 => _313.config, 'optionalAccess', _314 => _314.weapp, 'optionalAccess', _315 => _315.autoImportComponents])
21334
+ _optionalChain([inlineConfig, 'optionalAccess', _320 => _320.weapp, 'optionalAccess', _321 => _321.autoImportComponents]),
21335
+ _optionalChain([loadedConfig, 'access', _322 => _322.weapp, 'optionalAccess', _323 => _323.autoImportComponents]),
21336
+ _optionalChain([weappLoaded, 'optionalAccess', _324 => _324.config, 'optionalAccess', _325 => _325.weapp, 'optionalAccess', _326 => _326.autoImportComponents])
21194
21337
  ].some((value) => value !== void 0)
21195
21338
  };
21196
21339
  migrateEnhanceOptions(config.weapp, {
21197
21340
  warn: shouldWarnEnhance,
21198
21341
  userConfigured: userConfiguredTopLevel
21199
21342
  });
21200
- const srcRoot = _nullishCoalesce(_optionalChain([config, 'access', _316 => _316.weapp, 'optionalAccess', _317 => _317.srcRoot]), () => ( ""));
21343
+ const srcRoot = _nullishCoalesce(_optionalChain([config, 'access', _327 => _327.weapp, 'optionalAccess', _328 => _328.srcRoot]), () => ( ""));
21201
21344
  const resolvedWebConfig = resolveWeappWebConfig({
21202
21345
  cwd,
21203
21346
  srcRoot,
21204
- config: _optionalChain([config, 'access', _318 => _318.weapp, 'optionalAccess', _319 => _319.web])
21347
+ config: _optionalChain([config, 'access', _329 => _329.weapp, 'optionalAccess', _330 => _330.web])
21205
21348
  });
21206
21349
  const buildConfig = _nullishCoalesce(config.build, () => ( (config.build = {})));
21207
- const jsFormat = _nullishCoalesce(_optionalChain([config, 'access', _320 => _320.weapp, 'optionalAccess', _321 => _321.jsFormat]), () => ( "cjs"));
21208
- const enableLegacyEs5 = _optionalChain([config, 'access', _322 => _322.weapp, 'optionalAccess', _323 => _323.es5]) === true;
21350
+ const jsFormat = _nullishCoalesce(_optionalChain([config, 'access', _331 => _331.weapp, 'optionalAccess', _332 => _332.jsFormat]), () => ( "cjs"));
21351
+ const enableLegacyEs5 = _optionalChain([config, 'access', _333 => _333.weapp, 'optionalAccess', _334 => _334.es5]) === true;
21209
21352
  if (enableLegacyEs5 && jsFormat !== "cjs") {
21210
21353
  throw new Error('`weapp.es5` \u4EC5\u652F\u6301\u5728 `weapp.jsFormat` \u4E3A "cjs" \u65F6\u4F7F\u7528\uFF0C\u8BF7\u5207\u6362\u5230 CommonJS \u6216\u5173\u95ED\u8BE5\u9009\u9879\u3002');
21211
21354
  }
@@ -21252,11 +21395,11 @@ function createLoadConfig(options) {
21252
21395
  config.plugins ??= [];
21253
21396
  config.plugins.unshift(oxcVitePlugin);
21254
21397
  }
21255
- const platform = _nullishCoalesce(_optionalChain([config, 'access', _324 => _324.weapp, 'optionalAccess', _325 => _325.platform]), () => ( DEFAULT_MP_PLATFORM));
21256
- const aliasEntries = getAliasEntries(_optionalChain([config, 'access', _326 => _326.weapp, 'optionalAccess', _327 => _327.jsonAlias]));
21398
+ const platform = _nullishCoalesce(_optionalChain([config, 'access', _335 => _335.weapp, 'optionalAccess', _336 => _336.platform]), () => ( DEFAULT_MP_PLATFORM));
21399
+ const aliasEntries = getAliasEntries(_optionalChain([config, 'access', _337 => _337.weapp, 'optionalAccess', _338 => _338.jsonAlias]));
21257
21400
  config.plugins ??= [];
21258
- config.plugins.push(_vitetsconfigpaths2.default.call(void 0, _optionalChain([config, 'access', _328 => _328.weapp, 'optionalAccess', _329 => _329.tsconfigPaths])));
21259
- const configFilePath = _nullishCoalesce(_nullishCoalesce(_optionalChain([weappLoaded, 'optionalAccess', _330 => _330.path]), () => ( _optionalChain([loaded, 'optionalAccess', _331 => _331.path]))), () => ( resolvedConfigFile));
21401
+ config.plugins.push(_vitetsconfigpaths2.default.call(void 0, _optionalChain([config, 'access', _339 => _339.weapp, 'optionalAccess', _340 => _340.tsconfigPaths])));
21402
+ const configFilePath = _nullishCoalesce(_nullishCoalesce(_optionalChain([weappLoaded, 'optionalAccess', _341 => _341.path]), () => ( _optionalChain([loaded, 'optionalAccess', _342 => _342.path]))), () => ( resolvedConfigFile));
21260
21403
  const outputExtensions = getOutputExtensions(platform);
21261
21404
  const relativeSrcRoot = (p) => {
21262
21405
  if (srcRoot) {
@@ -21305,9 +21448,9 @@ function normalizeCopyGlobs(globs) {
21305
21448
  }
21306
21449
  function scanAssetFiles(configService, config) {
21307
21450
  const weappViteConfig = configService.weappViteConfig;
21308
- const include = normalizeCopyGlobs(_optionalChain([weappViteConfig, 'optionalAccess', _332 => _332.copy, 'optionalAccess', _333 => _333.include]));
21309
- const exclude = normalizeCopyGlobs(_optionalChain([weappViteConfig, 'optionalAccess', _334 => _334.copy, 'optionalAccess', _335 => _335.exclude]));
21310
- const filter3 = _nullishCoalesce(_optionalChain([weappViteConfig, 'optionalAccess', _336 => _336.copy, 'optionalAccess', _337 => _337.filter]), () => ( (() => true)));
21451
+ const include = normalizeCopyGlobs(_optionalChain([weappViteConfig, 'optionalAccess', _343 => _343.copy, 'optionalAccess', _344 => _344.include]));
21452
+ const exclude = normalizeCopyGlobs(_optionalChain([weappViteConfig, 'optionalAccess', _345 => _345.copy, 'optionalAccess', _346 => _346.exclude]));
21453
+ const filter3 = _nullishCoalesce(_optionalChain([weappViteConfig, 'optionalAccess', _347 => _347.copy, 'optionalAccess', _348 => _348.filter]), () => ( (() => true)));
21311
21454
  const ignore = [
21312
21455
  ...defaultExcluded,
21313
21456
  _pathe2.default.resolve(configService.cwd, `${config.build.outDir}/**/*`),
@@ -21365,7 +21508,7 @@ function createAssetCollector(state) {
21365
21508
  },
21366
21509
  async buildEnd() {
21367
21510
  const assets = await state.pendingAssets;
21368
- if (!_optionalChain([assets, 'optionalAccess', _338 => _338.length])) {
21511
+ if (!_optionalChain([assets, 'optionalAccess', _349 => _349.length])) {
21369
21512
  return;
21370
21513
  }
21371
21514
  for (const candidate of assets) {
@@ -21466,14 +21609,14 @@ function createAutoImportPlugin(state) {
21466
21609
  if (!state.resolvedConfig) {
21467
21610
  return;
21468
21611
  }
21469
- const weappConfig = configService.weappViteConfig;
21470
- const globs = _nullishCoalesce(_optionalChain([weappConfig, 'optionalAccess', _339 => _339.autoImportComponents, 'optionalAccess', _340 => _340.globs]), () => ( _optionalChain([weappConfig, 'optionalAccess', _341 => _341.enhance, 'optionalAccess', _342 => _342.autoImportComponents, 'optionalAccess', _343 => _343.globs])));
21471
- const globsKey = _nullishCoalesce(_optionalChain([globs, 'optionalAccess', _344 => _344.join, 'call', _345 => _345("\0")]), () => ( ""));
21612
+ const autoImportConfig = getAutoImportConfig(configService);
21613
+ const globs = _optionalChain([autoImportConfig, 'optionalAccess', _350 => _350.globs]);
21614
+ const globsKey = _nullishCoalesce(_optionalChain([globs, 'optionalAccess', _351 => _351.join, 'call', _352 => _352("\0")]), () => ( ""));
21472
21615
  if (globsKey !== state.lastGlobsKey) {
21473
21616
  state.initialScanDone = false;
21474
21617
  state.lastGlobsKey = globsKey;
21475
21618
  }
21476
- if (!_optionalChain([globs, 'optionalAccess', _346 => _346.length])) {
21619
+ if (!_optionalChain([globs, 'optionalAccess', _353 => _353.length])) {
21477
21620
  return;
21478
21621
  }
21479
21622
  if (state.initialScanDone) {
@@ -21564,14 +21707,14 @@ function createAutoRoutesPlugin(ctx) {
21564
21707
  if (!service.isRouteFile(id)) {
21565
21708
  return;
21566
21709
  }
21567
- const event = _optionalChain([change, 'optionalAccess', _347 => _347.event]);
21710
+ const event = _optionalChain([change, 'optionalAccess', _354 => _354.event]);
21568
21711
  await service.handleFileChange(id, event);
21569
21712
  },
21570
21713
  async handleHotUpdate(context) {
21571
21714
  if (!service.isRouteFile(context.file)) {
21572
21715
  return;
21573
21716
  }
21574
- if (_optionalChain([resolvedConfig, 'optionalAccess', _348 => _348.command]) === "serve") {
21717
+ if (_optionalChain([resolvedConfig, 'optionalAccess', _355 => _355.command]) === "serve") {
21575
21718
  await service.handleFileChange(context.file, "update");
21576
21719
  }
21577
21720
  const virtualModule = context.server.moduleGraph.getModuleById(RESOLVED_VIRTUAL_ID);
@@ -21795,7 +21938,7 @@ async function renderSharedStyleEntry(entry, _configService, resolvedConfig) {
21795
21938
  };
21796
21939
  }
21797
21940
  const processed = await _vite.preprocessCSS.call(void 0, css2, absolutePath, resolvedConfig);
21798
- const dependencies = _optionalChain([processed, 'optionalAccess', _349 => _349.deps]) ? dedupeAndNormalizeDependencies(absolutePath, processed.deps) : [];
21941
+ const dependencies = _optionalChain([processed, 'optionalAccess', _356 => _356.deps]) ? dedupeAndNormalizeDependencies(absolutePath, processed.deps) : [];
21799
21942
  const result = {
21800
21943
  css: processed.code,
21801
21944
  dependencies
@@ -21831,10 +21974,10 @@ function invalidateSharedStyleCache() {
21831
21974
  try {
21832
21975
  const sharedState = _chunkQKFYCWOCcjs.__require.call(void 0, request);
21833
21976
  if (sharedState) {
21834
- _optionalChain([sharedState, 'access', _350 => _350.contextMap, 'optionalAccess', _351 => _351.clear, 'optionalCall', _352 => _352()]);
21835
- _optionalChain([sharedState, 'access', _353 => _353.configContextMap, 'optionalAccess', _354 => _354.clear, 'optionalCall', _355 => _355()]);
21836
- _optionalChain([sharedState, 'access', _356 => _356.contextSourcesMap, 'optionalAccess', _357 => _357.clear, 'optionalCall', _358 => _358()]);
21837
- _optionalChain([sharedState, 'access', _359 => _359.sourceHashMap, 'optionalAccess', _360 => _360.clear, 'optionalCall', _361 => _361()]);
21977
+ _optionalChain([sharedState, 'access', _357 => _357.contextMap, 'optionalAccess', _358 => _358.clear, 'optionalCall', _359 => _359()]);
21978
+ _optionalChain([sharedState, 'access', _360 => _360.configContextMap, 'optionalAccess', _361 => _361.clear, 'optionalCall', _362 => _362()]);
21979
+ _optionalChain([sharedState, 'access', _363 => _363.contextSourcesMap, 'optionalAccess', _364 => _364.clear, 'optionalCall', _365 => _365()]);
21980
+ _optionalChain([sharedState, 'access', _366 => _366.sourceHashMap, 'optionalAccess', _367 => _367.clear, 'optionalCall', _368 => _368()]);
21838
21981
  break;
21839
21982
  }
21840
21983
  } catch (e26) {
@@ -21894,7 +22037,7 @@ function createChunkEmitter(configService, loadedEntrySet, debug4) {
21894
22037
  // @ts-ignore
21895
22038
  preserveSignature: "exports-only"
21896
22039
  });
21897
- _optionalChain([debug4, 'optionalCall', _362 => _362(`load ${fileName} \u8017\u65F6 ${(_perf_hooks.performance.now() - start).toFixed(2)}ms`)]);
22040
+ _optionalChain([debug4, 'optionalCall', _369 => _369(`load ${fileName} \u8017\u65F6 ${(_perf_hooks.performance.now() - start).toFixed(2)}ms`)]);
21898
22041
  });
21899
22042
  };
21900
22043
  }
@@ -23201,7 +23344,7 @@ function createEntryLoader(options) {
23201
23344
  registerJsonAsset,
23202
23345
  existsCache
23203
23346
  );
23204
- const pluginJsonPath = _optionalChain([scanService, 'optionalAccess', _363 => _363.pluginJsonPath]);
23347
+ const pluginJsonPath = _optionalChain([scanService, 'optionalAccess', _370 => _370.pluginJsonPath]);
23205
23348
  if (configService.absolutePluginRoot && pluginJsonPath) {
23206
23349
  this.addWatchFile(pluginJsonPath);
23207
23350
  const pluginJson = await jsonService.read(pluginJsonPath);
@@ -23249,13 +23392,13 @@ function createEntryLoader(options) {
23249
23392
  normalizedEntries,
23250
23393
  configService.absoluteSrcRoot
23251
23394
  );
23252
- _optionalChain([debug4, 'optionalCall', _364 => _364(`resolvedIds ${relativeCwdId} \u8017\u65F6 ${getTime()}`)]);
23395
+ _optionalChain([debug4, 'optionalCall', _371 => _371(`resolvedIds ${relativeCwdId} \u8017\u65F6 ${getTime()}`)]);
23253
23396
  const pendingResolvedIds = [];
23254
23397
  const combinedResolved = pluginResolvedRecords ? [...resolvedIds, ...pluginResolvedRecords] : resolvedIds;
23255
23398
  const pluginEntrySet = pluginResolvedRecords ? new Set(pluginResolvedRecords.map((record) => record.entry)) : void 0;
23256
23399
  for (const { entry, resolvedId } of combinedResolved) {
23257
23400
  if (!resolvedId) {
23258
- if (_optionalChain([pluginEntrySet, 'optionalAccess', _365 => _365.has, 'call', _366 => _366(entry)])) {
23401
+ if (_optionalChain([pluginEntrySet, 'optionalAccess', _372 => _372.has, 'call', _373 => _373(entry)])) {
23259
23402
  logger_default.warn(`\u6CA1\u6709\u627E\u5230\u63D2\u4EF6\u5165\u53E3 \`${entry}\` \u5BF9\u5E94\u7684\u811A\u672C\u6587\u4EF6\uFF0C\u8BF7\u68C0\u67E5\u8DEF\u5F84\u662F\u5426\u6B63\u786E!`);
23260
23403
  } else {
23261
23404
  logger_default.warn(`\u6CA1\u6709\u627E\u5230 \`${entry}\` \u7684\u5165\u53E3\u6587\u4EF6\uFF0C\u8BF7\u68C0\u67E5\u8DEF\u5F84\u662F\u5426\u6B63\u786E!`);
@@ -23270,7 +23413,7 @@ function createEntryLoader(options) {
23270
23413
  if (pendingResolvedIds.length) {
23271
23414
  await Promise.all(emitEntriesChunks.call(this, pendingResolvedIds));
23272
23415
  }
23273
- _optionalChain([debug4, 'optionalCall', _367 => _367(`emitEntriesChunks ${relativeCwdId} \u8017\u65F6 ${getTime()}`)]);
23416
+ _optionalChain([debug4, 'optionalCall', _374 => _374(`emitEntriesChunks ${relativeCwdId} \u8017\u65F6 ${getTime()}`)]);
23274
23417
  registerJsonAsset({
23275
23418
  jsonPath,
23276
23419
  json,
@@ -23285,7 +23428,7 @@ function createEntryLoader(options) {
23285
23428
  }
23286
23429
  const code = await _fsextra2.default.readFile(id, "utf8");
23287
23430
  const styleImports = await collectStyleImports(this, id, existsCache);
23288
- _optionalChain([debug4, 'optionalCall', _368 => _368(`loadEntry ${relativeCwdId} \u8017\u65F6 ${getTime()}`)]);
23431
+ _optionalChain([debug4, 'optionalCall', _375 => _375(`loadEntry ${relativeCwdId} \u8017\u65F6 ${getTime()}`)]);
23289
23432
  if (styleImports.length === 0) {
23290
23433
  return {
23291
23434
  code
@@ -23356,7 +23499,7 @@ function createTemplateScanner(wxmlService, debug4) {
23356
23499
  const { components: components2 } = wxmlToken;
23357
23500
  wxmlService.setWxmlComponentsMap(templateEntry, components2);
23358
23501
  }
23359
- _optionalChain([debug4, 'optionalCall', _369 => _369(`scanTemplateEntry ${templateEntry} \u8017\u65F6 ${(_perf_hooks.performance.now() - start).toFixed(2)}ms`)]);
23502
+ _optionalChain([debug4, 'optionalCall', _376 => _376(`scanTemplateEntry ${templateEntry} \u8017\u65F6 ${(_perf_hooks.performance.now() - start).toFixed(2)}ms`)]);
23360
23503
  };
23361
23504
  }
23362
23505
 
@@ -23530,7 +23673,7 @@ async function extractCssImportDependencies(ctx, importer) {
23530
23673
  if (!match2) {
23531
23674
  break;
23532
23675
  }
23533
- const rawSpecifier = _optionalChain([match2, 'access', _370 => _370[1], 'optionalAccess', _371 => _371.trim, 'call', _372 => _372()]);
23676
+ const rawSpecifier = _optionalChain([match2, 'access', _377 => _377[1], 'optionalAccess', _378 => _378.trim, 'call', _379 => _379()]);
23534
23677
  if (!rawSpecifier) {
23535
23678
  continue;
23536
23679
  }
@@ -23748,7 +23891,7 @@ function ensureSidecarWatcher(ctx, rootDir) {
23748
23891
  return;
23749
23892
  }
23750
23893
  const normalizedPath = _pathe2.default.normalize(input);
23751
- if (!_optionalChain([options, 'optionalAccess', _373 => _373.silent])) {
23894
+ if (!_optionalChain([options, 'optionalAccess', _380 => _380.silent])) {
23752
23895
  logger_default.info(`[watch:${event}] ${ctx.configService.relativeCwd(normalizedPath)}`);
23753
23896
  }
23754
23897
  handleSidecarChange(event, normalizedPath, isReady);
@@ -23780,7 +23923,7 @@ function ensureSidecarWatcher(ctx, rootDir) {
23780
23923
  return;
23781
23924
  }
23782
23925
  const relativeRoot = ctx.configService.relativeCwd(absRoot);
23783
- const code = _nullishCoalesce(_optionalChain([error, 'optionalAccess', _374 => _374.code]), () => ( "UNKNOWN"));
23926
+ const code = _nullishCoalesce(_optionalChain([error, 'optionalAccess', _381 => _381.code]), () => ( "UNKNOWN"));
23784
23927
  logger_default.warn(`[watch] ${relativeRoot} \u76D1\u542C\u6570\u91CF\u8FBE\u5230\u4E0A\u9650 (${code})\uFF0C\u4FA7\u8F66\u6587\u4EF6\u76D1\u542C\u5DF2\u505C\u7528`);
23785
23928
  });
23786
23929
  sidecarWatcherMap.set(absRoot, {
@@ -23944,7 +24087,7 @@ function createCacheKey(options) {
23944
24087
  return `${options.removeComment ? 1 : 0}|${options.transformEvent ? 1 : 0}`;
23945
24088
  }
23946
24089
  function getCachedResult(data2, cacheKey) {
23947
- return _optionalChain([handleCache, 'access', _375 => _375.get, 'call', _376 => _376(data2), 'optionalAccess', _377 => _377.get, 'call', _378 => _378(cacheKey)]);
24090
+ return _optionalChain([handleCache, 'access', _382 => _382.get, 'call', _383 => _383(data2), 'optionalAccess', _384 => _384.get, 'call', _385 => _385(cacheKey)]);
23948
24091
  }
23949
24092
  function setCachedResult(data2, cacheKey, result) {
23950
24093
  let cacheForToken = handleCache.get(data2);
@@ -24020,7 +24163,7 @@ function handleWxml(data2, options) {
24020
24163
  if (shouldTransformInlineWxs) {
24021
24164
  for (const { end, start, value } of inlineWxsTokens) {
24022
24165
  const { result } = getCachedInlineWxsTransform(value);
24023
- if (_optionalChain([result, 'optionalAccess', _379 => _379.code])) {
24166
+ if (_optionalChain([result, 'optionalAccess', _386 => _386.code])) {
24024
24167
  ms.update(start, end, `
24025
24168
  ${result.code}`);
24026
24169
  }
@@ -24071,11 +24214,11 @@ function emitWxmlAssetsWithCache(options) {
24071
24214
  });
24072
24215
  const emittedFiles = [];
24073
24216
  for (const { id, fileName, token } of currentPackageWxmls) {
24074
- _optionalChain([runtime, 'access', _380 => _380.addWatchFile, 'optionalCall', _381 => _381(id)]);
24217
+ _optionalChain([runtime, 'access', _387 => _387.addWatchFile, 'optionalCall', _388 => _388(id)]);
24075
24218
  const deps = wxmlService.depsMap.get(id);
24076
24219
  if (deps) {
24077
24220
  for (const dep of deps) {
24078
- _optionalChain([runtime, 'access', _382 => _382.addWatchFile, 'optionalCall', _383 => _383(dep)]);
24221
+ _optionalChain([runtime, 'access', _389 => _389.addWatchFile, 'optionalCall', _390 => _390(dep)]);
24079
24222
  }
24080
24223
  }
24081
24224
  emittedFiles.push(fileName);
@@ -24166,7 +24309,7 @@ function createTakeQueryPlugin(_state) {
24166
24309
  return null;
24167
24310
  }
24168
24311
  const resolved = await this.resolve(takeRequest.id, importer, { skipSelf: true });
24169
- if (_optionalChain([resolved, 'optionalAccess', _384 => _384.id])) {
24312
+ if (_optionalChain([resolved, 'optionalAccess', _391 => _391.id])) {
24170
24313
  markTakeModuleImporter(resolved.id, importer);
24171
24314
  if (takeRequest.legacy) {
24172
24315
  logger_default.warn(
@@ -24229,7 +24372,7 @@ function createCoreLifecyclePlugin(state) {
24229
24372
  buildService.invalidateIndependentOutput(independentRoot);
24230
24373
  scanService.markIndependentDirty(independentRoot);
24231
24374
  handledByIndependentWatcher = true;
24232
- if (_optionalChain([independentMeta, 'optionalAccess', _385 => _385.watchSharedStyles]) !== false) {
24375
+ if (_optionalChain([independentMeta, 'optionalAccess', _392 => _392.watchSharedStyles]) !== false) {
24233
24376
  invalidateSharedStyleCache();
24234
24377
  }
24235
24378
  }
@@ -24277,7 +24420,7 @@ function createCoreLifecyclePlugin(state) {
24277
24420
  options.input = scannedInput;
24278
24421
  },
24279
24422
  async load(id) {
24280
- _optionalChain([configService, 'access', _386 => _386.weappViteConfig, 'optionalAccess', _387 => _387.debug, 'optionalAccess', _388 => _388.load, 'optionalCall', _389 => _389(id, subPackageMeta)]);
24423
+ _optionalChain([configService, 'access', _393 => _393.weappViteConfig, 'optionalAccess', _394 => _394.debug, 'optionalAccess', _395 => _395.load, 'optionalCall', _396 => _396(id, subPackageMeta)]);
24281
24424
  const relativeBasename = _shared.removeExtensionDeep.call(void 0, configService.relativeAbsoluteSrcRoot(id));
24282
24425
  if (isCSSRequest(id)) {
24283
24426
  const parsed = parseRequest(id);
@@ -24291,7 +24434,7 @@ function createCoreLifecyclePlugin(state) {
24291
24434
  }
24292
24435
  return null;
24293
24436
  }
24294
- if (loadedEntrySet.has(id) || _optionalChain([subPackageMeta, 'optionalAccess', _390 => _390.entries, 'access', _391 => _391.includes, 'call', _392 => _392(relativeBasename)])) {
24437
+ if (loadedEntrySet.has(id) || _optionalChain([subPackageMeta, 'optionalAccess', _397 => _397.entries, 'access', _398 => _398.includes, 'call', _399 => _399(relativeBasename)])) {
24295
24438
  return await loadEntry.call(this, id, "component");
24296
24439
  }
24297
24440
  if (relativeBasename === "app") {
@@ -24322,10 +24465,10 @@ function createCoreLifecyclePlugin(state) {
24322
24465
  return subPackageRoots.find((root) => filePath === root || filePath.startsWith(`${root}/`));
24323
24466
  };
24324
24467
  var matchSubPackage = matchSubPackage2;
24325
- const sharedStrategy = _nullishCoalesce(_optionalChain([configService, 'access', _393 => _393.weappViteConfig, 'optionalAccess', _394 => _394.chunks, 'optionalAccess', _395 => _395.sharedStrategy]), () => ( DEFAULT_SHARED_CHUNK_STRATEGY));
24326
- const shouldLogChunks = _nullishCoalesce(_optionalChain([configService, 'access', _396 => _396.weappViteConfig, 'optionalAccess', _397 => _397.chunks, 'optionalAccess', _398 => _398.logOptimization]), () => ( true));
24468
+ const sharedStrategy = _nullishCoalesce(_optionalChain([configService, 'access', _400 => _400.weappViteConfig, 'optionalAccess', _401 => _401.chunks, 'optionalAccess', _402 => _402.sharedStrategy]), () => ( DEFAULT_SHARED_CHUNK_STRATEGY));
24469
+ const shouldLogChunks = _nullishCoalesce(_optionalChain([configService, 'access', _403 => _403.weappViteConfig, 'optionalAccess', _404 => _404.chunks, 'optionalAccess', _405 => _405.logOptimization]), () => ( true));
24327
24470
  const subPackageRoots = Array.from(scanService.subPackageMap.keys()).filter(Boolean);
24328
- const duplicateWarningBytes = Number(_nullishCoalesce(_optionalChain([configService, 'access', _399 => _399.weappViteConfig, 'optionalAccess', _400 => _400.chunks, 'optionalAccess', _401 => _401.duplicateWarningBytes]), () => ( 0)));
24471
+ const duplicateWarningBytes = Number(_nullishCoalesce(_optionalChain([configService, 'access', _406 => _406.weappViteConfig, 'optionalAccess', _407 => _407.chunks, 'optionalAccess', _408 => _408.duplicateWarningBytes]), () => ( 0)));
24329
24472
  const shouldWarnOnDuplicate = Number.isFinite(duplicateWarningBytes) && duplicateWarningBytes > 0;
24330
24473
  let redundantBytesTotal = 0;
24331
24474
  const handleDuplicate = shouldLogChunks || shouldWarnOnDuplicate ? ({ duplicates, ignoredMainImporters, chunkBytes, redundantBytes, retainedInMain, sharedFileName }) => {
@@ -24345,7 +24488,7 @@ function createCoreLifecyclePlugin(state) {
24345
24488
  }
24346
24489
  }
24347
24490
  const subPackageList = Array.from(subPackageSet).join("\u3001") || "\u76F8\u5173\u5206\u5305";
24348
- const ignoredHint = _optionalChain([ignoredMainImporters, 'optionalAccess', _402 => _402.length]) ? `\uFF0C\u5FFD\u7565\u4E3B\u5305\u5F15\u7528\uFF1A${ignoredMainImporters.join("\u3001")}` : "";
24491
+ const ignoredHint = _optionalChain([ignoredMainImporters, 'optionalAccess', _409 => _409.length]) ? `\uFF0C\u5FFD\u7565\u4E3B\u5305\u5F15\u7528\uFF1A${ignoredMainImporters.join("\u3001")}` : "";
24349
24492
  logger_default.info(`[subpackages] \u5206\u5305 ${subPackageList} \u5171\u4EAB\u6A21\u5757\u5DF2\u590D\u5236\u5230\u5404\u81EA weapp-shared/common.js\uFF08${totalReferences} \u5904\u5F15\u7528${ignoredHint}\uFF09`);
24350
24493
  if (retainedInMain) {
24351
24494
  logger_default.warn(`[subpackages] \u6A21\u5757 ${sharedFileName} \u540C\u65F6\u88AB\u4E3B\u5305\u5F15\u7528\uFF0C\u56E0\u6B64\u4ECD\u4FDD\u7559\u5728\u4E3B\u5305 common.js\uFF0C\u5E76\u590D\u5236\u5230 ${subPackageList}\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u9700\u8981\u5C06\u6E90\u4EE3\u7801\u79FB\u52A8\u5230\u4E3B\u5305\u6216\u516C\u5171\u76EE\u5F55\u3002`);
@@ -24386,10 +24529,10 @@ function createCoreLifecyclePlugin(state) {
24386
24529
  logger_default.warn(`[subpackages] \u5206\u5305\u590D\u5236\u5171\u4EAB\u6A21\u5757\u4EA7\u751F\u5197\u4F59\u4F53\u79EF ${formatBytes(redundantBytesTotal)}\uFF0C\u5DF2\u8D85\u8FC7\u9608\u503C ${formatBytes(duplicateWarningBytes)}\uFF0C\u5EFA\u8BAE\u8C03\u6574\u5206\u5305\u5212\u5206\u6216\u8FD0\u884C weapp-vite analyze \u5B9A\u4F4D\u95EE\u9898\u3002`);
24387
24530
  }
24388
24531
  }
24389
- if (_optionalChain([configService, 'access', _403 => _403.weappViteConfig, 'optionalAccess', _404 => _404.debug, 'optionalAccess', _405 => _405.watchFiles])) {
24532
+ if (_optionalChain([configService, 'access', _410 => _410.weappViteConfig, 'optionalAccess', _411 => _411.debug, 'optionalAccess', _412 => _412.watchFiles])) {
24390
24533
  const watcherService = ctx.watcherService;
24391
- const watcherRoot = _nullishCoalesce(_optionalChain([subPackageMeta, 'optionalAccess', _406 => _406.subPackage, 'access', _407 => _407.root]), () => ( "/"));
24392
- const watcher = _optionalChain([watcherService, 'optionalAccess', _408 => _408.getRollupWatcher, 'call', _409 => _409(watcherRoot)]);
24534
+ const watcherRoot = _nullishCoalesce(_optionalChain([subPackageMeta, 'optionalAccess', _413 => _413.subPackage, 'access', _414 => _414.root]), () => ( "/"));
24535
+ const watcher = _optionalChain([watcherService, 'optionalAccess', _415 => _415.getRollupWatcher, 'call', _416 => _416(watcherRoot)]);
24393
24536
  let watchFiles;
24394
24537
  if (watcher && typeof watcher.getWatchFiles === "function") {
24395
24538
  watchFiles = await watcher.getWatchFiles();
@@ -24403,7 +24546,7 @@ function createCoreLifecyclePlugin(state) {
24403
24546
  }
24404
24547
  },
24405
24548
  buildEnd() {
24406
- _optionalChain([debug2, 'optionalCall', _410 => _410(`${subPackageMeta ? `\u72EC\u7ACB\u5206\u5305 ${subPackageMeta.subPackage.root}` : "\u4E3B\u5305"} ${Array.from(this.getModuleIds()).length} \u4E2A\u6A21\u5757\u88AB\u7F16\u8BD1`)]);
24549
+ _optionalChain([debug2, 'optionalCall', _417 => _417(`${subPackageMeta ? `\u72EC\u7ACB\u5206\u5305 ${subPackageMeta.subPackage.root}` : "\u4E3B\u5305"} ${Array.from(this.getModuleIds()).length} \u4E2A\u6A21\u5757\u88AB\u7F16\u8BD1`)]);
24407
24550
  }
24408
24551
  };
24409
24552
  }
@@ -24502,7 +24645,7 @@ async function flushIndependentBuilds(state) {
24502
24645
  }
24503
24646
  const outputs = await Promise.all(pendingIndependentBuilds);
24504
24647
  for (const { rollup } of outputs) {
24505
- const bundleOutputs = Array.isArray(_optionalChain([rollup, 'optionalAccess', _411 => _411.output])) ? rollup.output : [];
24648
+ const bundleOutputs = Array.isArray(_optionalChain([rollup, 'optionalAccess', _418 => _418.output])) ? rollup.output : [];
24506
24649
  for (const output of bundleOutputs) {
24507
24650
  if (output.type === "chunk") {
24508
24651
  this.emitFile({
@@ -24539,13 +24682,13 @@ function toPosixPath(value) {
24539
24682
  var styleMatcherCache = /* @__PURE__ */ new WeakMap();
24540
24683
  function collectSharedStyleEntries(ctx, configService) {
24541
24684
  const map = /* @__PURE__ */ new Map();
24542
- const registry = _optionalChain([ctx, 'access', _412 => _412.scanService, 'optionalAccess', _413 => _413.subPackageMap]);
24543
- if (!_optionalChain([registry, 'optionalAccess', _414 => _414.size])) {
24685
+ const registry = _optionalChain([ctx, 'access', _419 => _419.scanService, 'optionalAccess', _420 => _420.subPackageMap]);
24686
+ if (!_optionalChain([registry, 'optionalAccess', _421 => _421.size])) {
24544
24687
  return map;
24545
24688
  }
24546
24689
  const currentRoot = configService.currentSubPackageRoot;
24547
24690
  for (const [root, meta] of registry.entries()) {
24548
- if (!_optionalChain([meta, 'access', _415 => _415.styleEntries, 'optionalAccess', _416 => _416.length])) {
24691
+ if (!_optionalChain([meta, 'access', _422 => _422.styleEntries, 'optionalAccess', _423 => _423.length])) {
24549
24692
  continue;
24550
24693
  }
24551
24694
  if (currentRoot && root !== currentRoot) {
@@ -24590,12 +24733,12 @@ function getStyleMatcher(entry) {
24590
24733
  if (cached) {
24591
24734
  return cached;
24592
24735
  }
24593
- const includePatterns = _optionalChain([entry, 'access', _417 => _417.include, 'optionalAccess', _418 => _418.length]) ? entry.include : ["**/*"];
24594
- const excludePatterns = _optionalChain([entry, 'access', _419 => _419.exclude, 'optionalAccess', _420 => _420.length]) ? entry.exclude : void 0;
24736
+ const includePatterns = _optionalChain([entry, 'access', _424 => _424.include, 'optionalAccess', _425 => _425.length]) ? entry.include : ["**/*"];
24737
+ const excludePatterns = _optionalChain([entry, 'access', _426 => _426.exclude, 'optionalAccess', _427 => _427.length]) ? entry.exclude : void 0;
24595
24738
  const matcher = {
24596
24739
  include: _picomatch2.default.call(void 0, includePatterns, { dot: true })
24597
24740
  };
24598
- if (_optionalChain([excludePatterns, 'optionalAccess', _421 => _421.length])) {
24741
+ if (_optionalChain([excludePatterns, 'optionalAccess', _428 => _428.length])) {
24599
24742
  matcher.exclude = _picomatch2.default.call(void 0, excludePatterns, { dot: true });
24600
24743
  }
24601
24744
  styleMatcherCache.set(entry, matcher);
@@ -24700,7 +24843,7 @@ function injectSharedStyleImports(css2, modulePath, fileName, sharedStyles, conf
24700
24843
  }
24701
24844
  const normalizedFileName = toPosixPath(fileName);
24702
24845
  const entries = findSharedStylesForModule(normalizedModule, normalizedFileName, sharedStyles);
24703
- if (!_optionalChain([entries, 'optionalAccess', _422 => _422.length])) {
24846
+ if (!_optionalChain([entries, 'optionalAccess', _429 => _429.length])) {
24704
24847
  return css2;
24705
24848
  }
24706
24849
  const specifiers = resolveImportSpecifiers(fileName, entries);
@@ -24912,14 +25055,14 @@ function createPluginPruner() {
24912
25055
  name: "weapp-vite:preflight",
24913
25056
  enforce: "pre",
24914
25057
  configResolved(config) {
24915
- if (!_optionalChain([config, 'access', _423 => _423.plugins, 'optionalAccess', _424 => _424.length])) {
25058
+ if (!_optionalChain([config, 'access', _430 => _430.plugins, 'optionalAccess', _431 => _431.length])) {
24916
25059
  return;
24917
25060
  }
24918
25061
  for (const removePlugin of removePlugins) {
24919
25062
  const idx = config.plugins.findIndex((plugin) => plugin.name === removePlugin);
24920
25063
  if (idx > -1) {
24921
25064
  const [plugin] = config.plugins.splice(idx, 1);
24922
- plugin && _optionalChain([debug3, 'optionalCall', _425 => _425("remove plugin", plugin.name)]);
25065
+ plugin && _optionalChain([debug3, 'optionalCall', _432 => _432("remove plugin", plugin.name)]);
24923
25066
  }
24924
25067
  }
24925
25068
  }
@@ -24975,8 +25118,8 @@ function createWorkerBuildPlugin(ctx) {
24975
25118
  name: "weapp-vite:workers",
24976
25119
  enforce: "pre",
24977
25120
  async options(options) {
24978
- const workerConfig = _optionalChain([configService, 'access', _426 => _426.weappViteConfig, 'optionalAccess', _427 => _427.worker]);
24979
- const entries = Array.isArray(_optionalChain([workerConfig, 'optionalAccess', _428 => _428.entry])) ? workerConfig.entry : [_optionalChain([workerConfig, 'optionalAccess', _429 => _429.entry])];
25121
+ const workerConfig = _optionalChain([configService, 'access', _433 => _433.weappViteConfig, 'optionalAccess', _434 => _434.worker]);
25122
+ const entries = Array.isArray(_optionalChain([workerConfig, 'optionalAccess', _435 => _435.entry])) ? workerConfig.entry : [_optionalChain([workerConfig, 'optionalAccess', _436 => _436.entry])];
24980
25123
  const normalized = (await Promise.all(entries.filter(Boolean).map((entry) => resolveWorkerEntry(ctx, entry)))).filter((result) => Boolean(result.value)).reduce((acc, cur) => {
24981
25124
  acc[cur.key] = cur.value;
24982
25125
  return acc;
@@ -25033,7 +25176,7 @@ async function transformWxsFile(state, wxsPath) {
25033
25176
  const { result, importees } = transformWxsCode(rawCode, {
25034
25177
  filename: wxsPath
25035
25178
  });
25036
- if (typeof _optionalChain([result, 'optionalAccess', _430 => _430.code]) === "string") {
25179
+ if (typeof _optionalChain([result, 'optionalAccess', _437 => _437.code]) === "string") {
25037
25180
  code = result.code;
25038
25181
  }
25039
25182
  const dirname5 = _pathe2.default.dirname(wxsPath);
@@ -25122,13 +25265,13 @@ function createContextPlugin(ctx) {
25122
25265
  }
25123
25266
  function attachRuntimePlugins(ctx, plugins) {
25124
25267
  const runtimePlugins = ctx[RUNTIME_PLUGINS_SYMBOL];
25125
- if (!_optionalChain([runtimePlugins, 'optionalAccess', _431 => _431.length])) {
25268
+ if (!_optionalChain([runtimePlugins, 'optionalAccess', _438 => _438.length])) {
25126
25269
  return plugins;
25127
25270
  }
25128
25271
  return [...runtimePlugins, ...plugins];
25129
25272
  }
25130
25273
  function applyInspect(ctx, plugins) {
25131
- const inspectOptions = _optionalChain([ctx, 'access', _432 => _432.configService, 'access', _433 => _433.weappViteConfig, 'optionalAccess', _434 => _434.debug, 'optionalAccess', _435 => _435.inspect]);
25274
+ const inspectOptions = _optionalChain([ctx, 'access', _439 => _439.configService, 'access', _440 => _440.weappViteConfig, 'optionalAccess', _441 => _441.debug, 'optionalAccess', _442 => _442.inspect]);
25132
25275
  if (!inspectOptions) {
25133
25276
  return plugins;
25134
25277
  }
@@ -25214,12 +25357,52 @@ function createMergeFactories(options) {
25214
25357
  injectBuiltinAliases(inlineConfig);
25215
25358
  return inlineConfig;
25216
25359
  }
25360
+ function normalizePluginOptions(option) {
25361
+ const normalized = [];
25362
+ if (!option) {
25363
+ return normalized;
25364
+ }
25365
+ if (Array.isArray(option)) {
25366
+ for (const entry of option) {
25367
+ normalized.push(...normalizePluginOptions(entry));
25368
+ }
25369
+ return normalized;
25370
+ }
25371
+ normalized.push(option);
25372
+ return normalized;
25373
+ }
25374
+ function isNamedPlugin(option, name) {
25375
+ return typeof option === "object" && option !== null && "name" in option && option.name === name;
25376
+ }
25377
+ function arrangePlugins(config, subPackageMeta) {
25378
+ const existing = normalizePluginOptions(config.plugins);
25379
+ const tsconfigPlugins = [];
25380
+ const others = [];
25381
+ for (const entry of existing) {
25382
+ if (!entry) {
25383
+ continue;
25384
+ }
25385
+ if (isNamedPlugin(entry, "vite-tsconfig-paths")) {
25386
+ tsconfigPlugins.push(entry);
25387
+ continue;
25388
+ }
25389
+ if (isNamedPlugin(entry, WEAPP_VITE_CONTEXT_PLUGIN_NAME)) {
25390
+ continue;
25391
+ }
25392
+ others.push(entry);
25393
+ }
25394
+ config.plugins = [
25395
+ vitePluginWeapp(ctx, subPackageMeta),
25396
+ ...others,
25397
+ ...tsconfigPlugins
25398
+ ];
25399
+ }
25217
25400
  function merge(subPackageMeta, ...configs) {
25218
25401
  ensureConfigService();
25219
25402
  const currentOptions = getOptions2();
25220
25403
  applyRuntimePlatform("miniprogram");
25221
25404
  const external = [];
25222
- if (_optionalChain([currentOptions, 'access', _436 => _436.packageJson, 'optionalAccess', _437 => _437.dependencies])) {
25405
+ if (_optionalChain([currentOptions, 'access', _443 => _443.packageJson, 'optionalAccess', _444 => _444.dependencies])) {
25223
25406
  external.push(
25224
25407
  ...Object.keys(currentOptions.packageJson.dependencies).map((pkg) => {
25225
25408
  return new RegExp(`^${pkg.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&")}(\\/|$)`);
@@ -25234,7 +25417,7 @@ function createMergeFactories(options) {
25234
25417
  const watchInclude = [
25235
25418
  _pathe2.default.join(currentOptions.cwd, currentOptions.srcRoot, "**")
25236
25419
  ];
25237
- const pluginRootConfig = _optionalChain([currentOptions, 'access', _438 => _438.config, 'access', _439 => _439.weapp, 'optionalAccess', _440 => _440.pluginRoot]);
25420
+ const pluginRootConfig = _optionalChain([currentOptions, 'access', _445 => _445.config, 'access', _446 => _446.weapp, 'optionalAccess', _447 => _447.pluginRoot]);
25238
25421
  if (pluginRootConfig) {
25239
25422
  const absolutePluginRoot = _pathe2.default.resolve(currentOptions.cwd, pluginRootConfig);
25240
25423
  const relativeToSrc = _pathe2.default.relative(
@@ -25250,7 +25433,6 @@ function createMergeFactories(options) {
25250
25433
  {
25251
25434
  root: currentOptions.cwd,
25252
25435
  mode: "development",
25253
- plugins: [vitePluginWeapp(ctx, subPackageMeta)],
25254
25436
  define: getDefineImportMetaEnv(),
25255
25437
  build: {
25256
25438
  watch: {
@@ -25270,6 +25452,7 @@ function createMergeFactories(options) {
25270
25452
  }
25271
25453
  }
25272
25454
  );
25455
+ arrangePlugins(inline, subPackageMeta);
25273
25456
  injectBuiltinAliases(inline);
25274
25457
  return inline;
25275
25458
  }
@@ -25278,9 +25461,6 @@ function createMergeFactories(options) {
25278
25461
  ...configs,
25279
25462
  {
25280
25463
  root: currentOptions.cwd,
25281
- plugins: [
25282
- vitePluginWeapp(ctx, subPackageMeta)
25283
- ],
25284
25464
  mode: "production",
25285
25465
  define: getDefineImportMetaEnv(),
25286
25466
  build: {
@@ -25292,9 +25472,10 @@ function createMergeFactories(options) {
25292
25472
  }
25293
25473
  }
25294
25474
  );
25475
+ arrangePlugins(inlineConfig, subPackageMeta);
25295
25476
  inlineConfig.logLevel = "info";
25296
25477
  injectBuiltinAliases(inlineConfig);
25297
- const currentRoot = _optionalChain([subPackageMeta, 'optionalAccess', _441 => _441.subPackage, 'access', _442 => _442.root]);
25478
+ const currentRoot = _optionalChain([subPackageMeta, 'optionalAccess', _448 => _448.subPackage, 'access', _449 => _449.root]);
25298
25479
  setOptions({
25299
25480
  ...currentOptions,
25300
25481
  currentSubPackageRoot: currentRoot
@@ -25305,7 +25486,7 @@ function createMergeFactories(options) {
25305
25486
  ensureConfigService();
25306
25487
  const currentOptions = getOptions2();
25307
25488
  const web = currentOptions.weappWeb;
25308
- if (!_optionalChain([web, 'optionalAccess', _443 => _443.enabled])) {
25489
+ if (!_optionalChain([web, 'optionalAccess', _450 => _450.enabled])) {
25309
25490
  return void 0;
25310
25491
  }
25311
25492
  applyRuntimePlatform("web");
@@ -25396,7 +25577,7 @@ function createConfigService(ctx) {
25396
25577
  defineEnv[key] = value;
25397
25578
  }
25398
25579
  function getDefineImportMetaEnv() {
25399
- const mpPlatform = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _444 => _444.platform]), () => ( DEFAULT_MP_PLATFORM));
25580
+ const mpPlatform = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _451 => _451.platform]), () => ( DEFAULT_MP_PLATFORM));
25400
25581
  const resolvedPlatform = _nullishCoalesce(defineEnv.PLATFORM, () => ( mpPlatform));
25401
25582
  const env = {
25402
25583
  PLATFORM: resolvedPlatform,
@@ -25412,7 +25593,7 @@ function createConfigService(ctx) {
25412
25593
  }
25413
25594
  function applyRuntimePlatform(runtime) {
25414
25595
  const isWeb = runtime === "web";
25415
- const mpPlatform = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _445 => _445.platform]), () => ( DEFAULT_MP_PLATFORM));
25596
+ const mpPlatform = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _452 => _452.platform]), () => ( DEFAULT_MP_PLATFORM));
25416
25597
  const resolvedPlatform = isWeb ? "web" : mpPlatform;
25417
25598
  setDefineEnv("PLATFORM", resolvedPlatform);
25418
25599
  setDefineEnv("IS_WEB", isWeb);
@@ -25523,10 +25704,10 @@ function createConfigService(ctx) {
25523
25704
  return options.srcRoot;
25524
25705
  },
25525
25706
  get pluginRoot() {
25526
- return _optionalChain([options, 'access', _446 => _446.config, 'access', _447 => _447.weapp, 'optionalAccess', _448 => _448.pluginRoot]);
25707
+ return _optionalChain([options, 'access', _453 => _453.config, 'access', _454 => _454.weapp, 'optionalAccess', _455 => _455.pluginRoot]);
25527
25708
  },
25528
25709
  get absolutePluginRoot() {
25529
- if (_optionalChain([options, 'access', _449 => _449.config, 'access', _450 => _450.weapp, 'optionalAccess', _451 => _451.pluginRoot])) {
25710
+ if (_optionalChain([options, 'access', _456 => _456.config, 'access', _457 => _457.weapp, 'optionalAccess', _458 => _458.pluginRoot])) {
25530
25711
  return _pathe2.default.resolve(options.cwd, options.config.weapp.pluginRoot);
25531
25712
  }
25532
25713
  },
@@ -25556,7 +25737,7 @@ function createConfigService(ctx) {
25556
25737
  },
25557
25738
  relativeAbsoluteSrcRoot(p) {
25558
25739
  const absoluteSrcRoot = _pathe2.default.resolve(options.cwd, options.srcRoot);
25559
- const pluginRootConfig = _optionalChain([options, 'access', _452 => _452.config, 'access', _453 => _453.weapp, 'optionalAccess', _454 => _454.pluginRoot]);
25740
+ const pluginRootConfig = _optionalChain([options, 'access', _459 => _459.config, 'access', _460 => _460.weapp, 'optionalAccess', _461 => _461.pluginRoot]);
25560
25741
  if (pluginRootConfig) {
25561
25742
  const absolutePluginRoot = _pathe2.default.resolve(options.cwd, pluginRootConfig);
25562
25743
  const relativeToPlugin = _pathe2.default.relative(absolutePluginRoot, p);
@@ -25608,10 +25789,10 @@ function createJsonService(ctx) {
25608
25789
  }
25609
25790
  let resultJson;
25610
25791
  if (/app\.json(?:\.[jt]s)?$/.test(filepath)) {
25611
- await _optionalChain([ctx, 'access', _455 => _455.autoRoutesService, 'optionalAccess', _456 => _456.ensureFresh, 'call', _457 => _457()]);
25792
+ await _optionalChain([ctx, 'access', _462 => _462.autoRoutesService, 'optionalAccess', _463 => _463.ensureFresh, 'call', _464 => _464()]);
25612
25793
  }
25613
25794
  if (/\.json\.[jt]s$/.test(filepath)) {
25614
- const routesReference = _optionalChain([ctx, 'access', _458 => _458.autoRoutesService, 'optionalAccess', _459 => _459.getReference, 'call', _460 => _460()]);
25795
+ const routesReference = _optionalChain([ctx, 'access', _465 => _465.autoRoutesService, 'optionalAccess', _466 => _466.getReference, 'call', _467 => _467()]);
25615
25796
  const fallbackRoutes = _nullishCoalesce(routesReference, () => ( { pages: [], entries: [], subPackages: [] }));
25616
25797
  const routesModule = {
25617
25798
  routes: fallbackRoutes,
@@ -25660,7 +25841,7 @@ function createJsonService(ctx) {
25660
25841
  return resultJson;
25661
25842
  } catch (error) {
25662
25843
  logger_default.error(`\u6B8B\u7834\u7684JSON\u6587\u4EF6: ${filepath}`);
25663
- _optionalChain([debug, 'optionalCall', _461 => _461(error)]);
25844
+ _optionalChain([debug, 'optionalCall', _468 => _468(error)]);
25664
25845
  }
25665
25846
  }
25666
25847
  function resolve8(entry) {
@@ -25715,7 +25896,7 @@ function createNpmService(ctx) {
25715
25896
  if (!ctx.configService) {
25716
25897
  throw new Error("configService must be initialized before writing npm cache");
25717
25898
  }
25718
- if (_optionalChain([ctx, 'access', _462 => _462.configService, 'access', _463 => _463.weappViteConfig, 'optionalAccess', _464 => _464.npm, 'optionalAccess', _465 => _465.cache])) {
25899
+ if (_optionalChain([ctx, 'access', _469 => _469.configService, 'access', _470 => _470.weappViteConfig, 'optionalAccess', _471 => _471.npm, 'optionalAccess', _472 => _472.cache])) {
25719
25900
  await _fsextra2.default.outputJSON(getDependenciesCacheFilePath(root), {
25720
25901
  hash: dependenciesCacheHash()
25721
25902
  });
@@ -25728,7 +25909,7 @@ function createNpmService(ctx) {
25728
25909
  }
25729
25910
  }
25730
25911
  async function checkDependenciesCacheOutdate(root) {
25731
- if (_optionalChain([ctx, 'access', _466 => _466.configService, 'optionalAccess', _467 => _467.weappViteConfig, 'optionalAccess', _468 => _468.npm, 'optionalAccess', _469 => _469.cache])) {
25912
+ if (_optionalChain([ctx, 'access', _473 => _473.configService, 'optionalAccess', _474 => _474.weappViteConfig, 'optionalAccess', _475 => _475.npm, 'optionalAccess', _476 => _476.cache])) {
25732
25913
  const json = await readDependenciesCache(root);
25733
25914
  if (_shared.isObject.call(void 0, json)) {
25734
25915
  return dependenciesCacheHash() !== json.hash;
@@ -25761,7 +25942,7 @@ function createNpmService(ctx) {
25761
25942
  target: "es6",
25762
25943
  external: []
25763
25944
  });
25764
- const resolvedOptions = _optionalChain([ctx, 'access', _470 => _470.configService, 'optionalAccess', _471 => _471.weappViteConfig, 'optionalAccess', _472 => _472.npm, 'optionalAccess', _473 => _473.buildOptions, 'optionalCall', _474 => _474(
25945
+ const resolvedOptions = _optionalChain([ctx, 'access', _477 => _477.configService, 'optionalAccess', _478 => _478.weappViteConfig, 'optionalAccess', _479 => _479.npm, 'optionalAccess', _480 => _480.buildOptions, 'optionalCall', _481 => _481(
25765
25946
  mergedOptions,
25766
25947
  { name, entry }
25767
25948
  )]);
@@ -25861,7 +26042,7 @@ function createNpmService(ctx) {
25861
26042
  throw new Error("configService must be initialized before resolving npm relation list");
25862
26043
  }
25863
26044
  let packNpmRelationList = [];
25864
- if (_optionalChain([ctx, 'access', _475 => _475.configService, 'access', _476 => _476.projectConfig, 'access', _477 => _477.setting, 'optionalAccess', _478 => _478.packNpmManually]) && Array.isArray(ctx.configService.projectConfig.setting.packNpmRelationList)) {
26045
+ if (_optionalChain([ctx, 'access', _482 => _482.configService, 'access', _483 => _483.projectConfig, 'access', _484 => _484.setting, 'optionalAccess', _485 => _485.packNpmManually]) && Array.isArray(ctx.configService.projectConfig.setting.packNpmRelationList)) {
25865
26046
  packNpmRelationList = ctx.configService.projectConfig.setting.packNpmRelationList;
25866
26047
  } else {
25867
26048
  packNpmRelationList = [
@@ -25874,10 +26055,10 @@ function createNpmService(ctx) {
25874
26055
  return packNpmRelationList;
25875
26056
  }
25876
26057
  async function build3(options) {
25877
- if (!_optionalChain([ctx, 'access', _479 => _479.configService, 'optionalAccess', _480 => _480.weappViteConfig, 'optionalAccess', _481 => _481.npm, 'optionalAccess', _482 => _482.enable])) {
26058
+ if (!_optionalChain([ctx, 'access', _486 => _486.configService, 'optionalAccess', _487 => _487.weappViteConfig, 'optionalAccess', _488 => _488.npm, 'optionalAccess', _489 => _489.enable])) {
25878
26059
  return;
25879
26060
  }
25880
- _optionalChain([debug, 'optionalCall', _483 => _483("buildNpm start")]);
26061
+ _optionalChain([debug, 'optionalCall', _490 => _490("buildNpm start")]);
25881
26062
  const packNpmRelationList = getPackNpmRelationList();
25882
26063
  const [mainRelation, ...subRelations] = packNpmRelationList;
25883
26064
  const packageJsonPath = _pathe2.default.resolve(ctx.configService.cwd, mainRelation.packageJsonPath);
@@ -25952,7 +26133,7 @@ function createNpmService(ctx) {
25952
26133
  }
25953
26134
  }
25954
26135
  }
25955
- _optionalChain([debug, 'optionalCall', _484 => _484("buildNpm end")]);
26136
+ _optionalChain([debug, 'optionalCall', _491 => _491("buildNpm end")]);
25956
26137
  }
25957
26138
  return {
25958
26139
  getDependenciesCacheFilePath,
@@ -25996,7 +26177,7 @@ var TimeoutError = (_class16 = class _TimeoutError extends Error {
25996
26177
  __init36() {this.name = "TimeoutError"}
25997
26178
  constructor(message, options) {
25998
26179
  super(message, options);_class16.prototype.__init36.call(this);;
25999
- _optionalChain([Error, 'access', _485 => _485.captureStackTrace, 'optionalCall', _486 => _486(this, _TimeoutError)]);
26180
+ _optionalChain([Error, 'access', _492 => _492.captureStackTrace, 'optionalCall', _493 => _493(this, _TimeoutError)]);
26000
26181
  }
26001
26182
  }, _class16);
26002
26183
  var getAbortedReason = (signal) => _nullishCoalesce(signal.reason, () => ( new DOMException("This operation was aborted.", "AbortError")));
@@ -26014,7 +26195,7 @@ function pTimeout(promise, options) {
26014
26195
  if (typeof milliseconds !== "number" || Math.sign(milliseconds) !== 1) {
26015
26196
  throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${milliseconds}\``);
26016
26197
  }
26017
- if (_optionalChain([signal, 'optionalAccess', _487 => _487.aborted])) {
26198
+ if (_optionalChain([signal, 'optionalAccess', _494 => _494.aborted])) {
26018
26199
  reject(getAbortedReason(signal));
26019
26200
  return;
26020
26201
  }
@@ -26112,7 +26293,7 @@ var PriorityQueue = class {
26112
26293
  }
26113
26294
  dequeue() {
26114
26295
  const item = this.#queue.shift();
26115
- return _optionalChain([item, 'optionalAccess', _488 => _488.run]);
26296
+ return _optionalChain([item, 'optionalAccess', _495 => _495.run]);
26116
26297
  }
26117
26298
  filter(options) {
26118
26299
  return this.#queue.filter((element) => element.priority === options.priority).map((element) => element.run);
@@ -26173,10 +26354,10 @@ var PQueue = class extends import_index2.default {
26173
26354
  ...options
26174
26355
  };
26175
26356
  if (!(typeof options.intervalCap === "number" && options.intervalCap >= 1)) {
26176
- throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${_nullishCoalesce(_optionalChain([options, 'access', _489 => _489.intervalCap, 'optionalAccess', _490 => _490.toString, 'call', _491 => _491()]), () => ( ""))}\` (${typeof options.intervalCap})`);
26357
+ throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${_nullishCoalesce(_optionalChain([options, 'access', _496 => _496.intervalCap, 'optionalAccess', _497 => _497.toString, 'call', _498 => _498()]), () => ( ""))}\` (${typeof options.intervalCap})`);
26177
26358
  }
26178
26359
  if (options.interval === void 0 || !(Number.isFinite(options.interval) && options.interval >= 0)) {
26179
- throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${_nullishCoalesce(_optionalChain([options, 'access', _492 => _492.interval, 'optionalAccess', _493 => _493.toString, 'call', _494 => _494()]), () => ( ""))}\` (${typeof options.interval})`);
26360
+ throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${_nullishCoalesce(_optionalChain([options, 'access', _499 => _499.interval, 'optionalAccess', _500 => _500.toString, 'call', _501 => _501()]), () => ( ""))}\` (${typeof options.interval})`);
26180
26361
  }
26181
26362
  this.#carryoverIntervalCount = _nullishCoalesce(_nullishCoalesce(options.carryoverIntervalCount, () => ( options.carryoverConcurrencyCount)), () => ( false));
26182
26363
  this.#isIntervalIgnored = options.intervalCap === Number.POSITIVE_INFINITY || options.interval === 0;
@@ -26383,7 +26564,7 @@ var PQueue = class extends import_index2.default {
26383
26564
  });
26384
26565
  try {
26385
26566
  try {
26386
- _optionalChain([options, 'access', _495 => _495.signal, 'optionalAccess', _496 => _496.throwIfAborted, 'call', _497 => _497()]);
26567
+ _optionalChain([options, 'access', _502 => _502.signal, 'optionalAccess', _503 => _503.throwIfAborted, 'call', _504 => _504()]);
26387
26568
  } catch (error) {
26388
26569
  if (!this.#isIntervalIgnored) {
26389
26570
  this.#intervalCount--;
@@ -26756,7 +26937,7 @@ var FileCache = class {
26756
26937
  return true;
26757
26938
  }
26758
26939
  const cachedMtime = this.mtimeMap.get(id);
26759
- const nextSignature = _optionalChain([options, 'optionalAccess', _498 => _498.content]) !== void 0 ? createSignature(options.content) : void 0;
26940
+ const nextSignature = _optionalChain([options, 'optionalAccess', _505 => _505.content]) !== void 0 ? createSignature(options.content) : void 0;
26760
26941
  const updateSignature = () => {
26761
26942
  if (nextSignature !== void 0) {
26762
26943
  this.signatureMap.set(id, nextSignature);
@@ -26991,7 +27172,7 @@ function coerceStyleConfig(entry) {
26991
27172
  if (!entry || typeof entry !== "object") {
26992
27173
  return void 0;
26993
27174
  }
26994
- const source = _optionalChain([entry, 'access', _499 => _499.source, 'optionalAccess', _500 => _500.toString, 'call', _501 => _501(), 'access', _502 => _502.trim, 'call', _503 => _503()]);
27175
+ const source = _optionalChain([entry, 'access', _506 => _506.source, 'optionalAccess', _507 => _507.toString, 'call', _508 => _508(), 'access', _509 => _509.trim, 'call', _510 => _510()]);
26995
27176
  if (!source) {
26996
27177
  return void 0;
26997
27178
  }
@@ -27167,7 +27348,7 @@ function normalizeSubPackageStyleEntries(styles, subPackage, configService) {
27167
27348
  if (!service) {
27168
27349
  return void 0;
27169
27350
  }
27170
- const root = _optionalChain([subPackage, 'access', _504 => _504.root, 'optionalAccess', _505 => _505.trim, 'call', _506 => _506()]);
27351
+ const root = _optionalChain([subPackage, 'access', _511 => _511.root, 'optionalAccess', _512 => _512.trim, 'call', _513 => _513()]);
27171
27352
  if (!root) {
27172
27353
  return void 0;
27173
27354
  }
@@ -27275,7 +27456,7 @@ function createScanService(ctx) {
27275
27456
  if (!ctx.configService) {
27276
27457
  throw new Error("configService must be initialized before scanning subpackages");
27277
27458
  }
27278
- const json = _optionalChain([scanState, 'access', _507 => _507.appEntry, 'optionalAccess', _508 => _508.json]);
27459
+ const json = _optionalChain([scanState, 'access', _514 => _514.appEntry, 'optionalAccess', _515 => _515.json]);
27279
27460
  if (scanState.isDirty || subPackageMap.size === 0) {
27280
27461
  subPackageMap.clear();
27281
27462
  independentSubPackageMap.clear();
@@ -27293,15 +27474,16 @@ function createScanService(ctx) {
27293
27474
  subPackage,
27294
27475
  entries: resolveSubPackageEntries(subPackage)
27295
27476
  };
27296
- const subPackageConfig = _optionalChain([ctx, 'access', _509 => _509.configService, 'access', _510 => _510.weappViteConfig, 'optionalAccess', _511 => _511.subPackages, 'optionalAccess', _512 => _512[subPackage.root]]);
27297
- meta.subPackage.dependencies = _optionalChain([subPackageConfig, 'optionalAccess', _513 => _513.dependencies]);
27298
- meta.subPackage.inlineConfig = _optionalChain([subPackageConfig, 'optionalAccess', _514 => _514.inlineConfig]);
27477
+ const subPackageConfig = _optionalChain([ctx, 'access', _516 => _516.configService, 'access', _517 => _517.weappViteConfig, 'optionalAccess', _518 => _518.subPackages, 'optionalAccess', _519 => _519[subPackage.root]]);
27478
+ meta.subPackage.dependencies = _optionalChain([subPackageConfig, 'optionalAccess', _520 => _520.dependencies]);
27479
+ meta.subPackage.inlineConfig = _optionalChain([subPackageConfig, 'optionalAccess', _521 => _521.inlineConfig]);
27480
+ meta.autoImportComponents = _optionalChain([subPackageConfig, 'optionalAccess', _522 => _522.autoImportComponents]);
27299
27481
  meta.styleEntries = normalizeSubPackageStyleEntries(
27300
- _optionalChain([subPackageConfig, 'optionalAccess', _515 => _515.styles]),
27482
+ _optionalChain([subPackageConfig, 'optionalAccess', _523 => _523.styles]),
27301
27483
  subPackage,
27302
27484
  ctx.configService
27303
27485
  );
27304
- meta.watchSharedStyles = _nullishCoalesce(_optionalChain([subPackageConfig, 'optionalAccess', _516 => _516.watchSharedStyles]), () => ( true));
27486
+ meta.watchSharedStyles = _nullishCoalesce(_optionalChain([subPackageConfig, 'optionalAccess', _524 => _524.watchSharedStyles]), () => ( true));
27305
27487
  metas.push(meta);
27306
27488
  if (subPackage.root) {
27307
27489
  subPackageMap.set(subPackage.root, meta);
@@ -27357,11 +27539,11 @@ function createScanService(ctx) {
27357
27539
  loadSubPackages,
27358
27540
  isMainPackageFileName,
27359
27541
  get workersOptions() {
27360
- return _optionalChain([scanState, 'access', _517 => _517.appEntry, 'optionalAccess', _518 => _518.json, 'optionalAccess', _519 => _519.workers]);
27542
+ return _optionalChain([scanState, 'access', _525 => _525.appEntry, 'optionalAccess', _526 => _526.json, 'optionalAccess', _527 => _527.workers]);
27361
27543
  },
27362
27544
  get workersDir() {
27363
- const workersOptions = _optionalChain([scanState, 'access', _520 => _520.appEntry, 'optionalAccess', _521 => _521.json, 'optionalAccess', _522 => _522.workers]);
27364
- return typeof workersOptions === "object" ? _optionalChain([workersOptions, 'optionalAccess', _523 => _523.path]) : workersOptions;
27545
+ const workersOptions = _optionalChain([scanState, 'access', _528 => _528.appEntry, 'optionalAccess', _529 => _529.json, 'optionalAccess', _530 => _530.workers]);
27546
+ return typeof workersOptions === "object" ? _optionalChain([workersOptions, 'optionalAccess', _531 => _531.path]) : workersOptions;
27365
27547
  },
27366
27548
  markDirty() {
27367
27549
  scanState.isDirty = true;
@@ -27408,7 +27590,7 @@ function createWatcherService(ctx) {
27408
27590
  },
27409
27591
  setRollupWatcher(watcher, root = "/") {
27410
27592
  const oldWatcher = rollupWatcherMap.get(root);
27411
- _optionalChain([oldWatcher, 'optionalAccess', _524 => _524.close, 'call', _525 => _525()]);
27593
+ _optionalChain([oldWatcher, 'optionalAccess', _532 => _532.close, 'call', _533 => _533()]);
27412
27594
  rollupWatcherMap.set(root, watcher);
27413
27595
  },
27414
27596
  closeAll() {
@@ -27421,7 +27603,7 @@ function createWatcherService(ctx) {
27421
27603
  });
27422
27604
  });
27423
27605
  sidecarWatcherMap.clear();
27424
- void _optionalChain([ctx, 'access', _526 => _526.webService, 'optionalAccess', _527 => _527.close, 'call', _528 => _528(), 'access', _529 => _529.catch, 'call', _530 => _530(() => {
27606
+ void _optionalChain([ctx, 'access', _534 => _534.webService, 'optionalAccess', _535 => _535.close, 'call', _536 => _536(), 'access', _537 => _537.catch, 'call', _538 => _538(() => {
27425
27607
  })]);
27426
27608
  },
27427
27609
  close(root = "/") {
@@ -27437,7 +27619,7 @@ function createWatcherService(ctx) {
27437
27619
  sidecarWatcherMap.delete(root);
27438
27620
  }
27439
27621
  if (rollupWatcherMap.size === 0 && sidecarWatcherMap.size === 0) {
27440
- void _optionalChain([ctx, 'access', _531 => _531.webService, 'optionalAccess', _532 => _532.close, 'call', _533 => _533(), 'access', _534 => _534.catch, 'call', _535 => _535(() => {
27622
+ void _optionalChain([ctx, 'access', _539 => _539.webService, 'optionalAccess', _540 => _540.close, 'call', _541 => _541(), 'access', _542 => _542.catch, 'call', _543 => _543(() => {
27441
27623
  })]);
27442
27624
  }
27443
27625
  }
@@ -27450,7 +27632,7 @@ function createWatcherServicePlugin(ctx) {
27450
27632
  name: "weapp-runtime:watcher-service",
27451
27633
  closeBundle() {
27452
27634
  const configService = ctx.configService;
27453
- const isWatchMode = _optionalChain([configService, 'optionalAccess', _536 => _536.isDev]) || Boolean(_optionalChain([configService, 'optionalAccess', _537 => _537.inlineConfig, 'optionalAccess', _538 => _538.build, 'optionalAccess', _539 => _539.watch]));
27635
+ const isWatchMode = _optionalChain([configService, 'optionalAccess', _544 => _544.isDev]) || Boolean(_optionalChain([configService, 'optionalAccess', _545 => _545.inlineConfig, 'optionalAccess', _546 => _546.build, 'optionalAccess', _547 => _547.watch]));
27454
27636
  if (!isWatchMode) {
27455
27637
  service.closeAll();
27456
27638
  }
@@ -27467,10 +27649,10 @@ function createWebService(ctx) {
27467
27649
  }
27468
27650
  let devServer;
27469
27651
  function isEnabled() {
27470
- return Boolean(_optionalChain([ctx, 'access', _540 => _540.configService, 'optionalAccess', _541 => _541.weappWebConfig, 'optionalAccess', _542 => _542.enabled]));
27652
+ return Boolean(_optionalChain([ctx, 'access', _548 => _548.configService, 'optionalAccess', _549 => _549.weappWebConfig, 'optionalAccess', _550 => _550.enabled]));
27471
27653
  }
27472
27654
  async function startDevServer() {
27473
- if (!_optionalChain([ctx, 'access', _543 => _543.configService, 'optionalAccess', _544 => _544.isDev])) {
27655
+ if (!_optionalChain([ctx, 'access', _551 => _551.configService, 'optionalAccess', _552 => _552.isDev])) {
27474
27656
  return void 0;
27475
27657
  }
27476
27658
  if (!isEnabled()) {
@@ -27479,7 +27661,7 @@ function createWebService(ctx) {
27479
27661
  if (devServer) {
27480
27662
  return devServer;
27481
27663
  }
27482
- const inlineConfig = _optionalChain([ctx, 'access', _545 => _545.configService, 'optionalAccess', _546 => _546.mergeWeb, 'call', _547 => _547()]);
27664
+ const inlineConfig = _optionalChain([ctx, 'access', _553 => _553.configService, 'optionalAccess', _554 => _554.mergeWeb, 'call', _555 => _555()]);
27483
27665
  if (!inlineConfig) {
27484
27666
  return void 0;
27485
27667
  }
@@ -27492,7 +27674,7 @@ function createWebService(ctx) {
27492
27674
  if (!isEnabled()) {
27493
27675
  return void 0;
27494
27676
  }
27495
- const inlineConfig = _optionalChain([ctx, 'access', _548 => _548.configService, 'optionalAccess', _549 => _549.mergeWeb, 'call', _550 => _550()]);
27677
+ const inlineConfig = _optionalChain([ctx, 'access', _556 => _556.configService, 'optionalAccess', _557 => _557.mergeWeb, 'call', _558 => _558()]);
27496
27678
  if (!inlineConfig) {
27497
27679
  return void 0;
27498
27680
  }
@@ -27522,7 +27704,7 @@ function createWebServicePlugin(ctx) {
27522
27704
  return {
27523
27705
  name: "weapp-runtime:web-service",
27524
27706
  async closeBundle() {
27525
- if (!_optionalChain([ctx, 'access', _551 => _551.configService, 'optionalAccess', _552 => _552.isDev])) {
27707
+ if (!_optionalChain([ctx, 'access', _559 => _559.configService, 'optionalAccess', _560 => _560.isDev])) {
27526
27708
  await service.close();
27527
27709
  }
27528
27710
  }
@@ -30171,7 +30353,7 @@ function createWxmlService(ctx) {
30171
30353
  return set3;
30172
30354
  }
30173
30355
  function clearAll() {
30174
- const currentRoot = _optionalChain([ctx, 'access', _553 => _553.configService, 'optionalAccess', _554 => _554.currentSubPackageRoot]);
30356
+ const currentRoot = _optionalChain([ctx, 'access', _561 => _561.configService, 'optionalAccess', _562 => _562.currentSubPackageRoot]);
30175
30357
  if (!currentRoot) {
30176
30358
  depsMap.clear();
30177
30359
  tokenMap.clear();
@@ -30230,7 +30412,7 @@ function createWxmlService(ctx) {
30230
30412
  if (!ctx.configService) {
30231
30413
  throw new Error("configService must be initialized before scanning wxml");
30232
30414
  }
30233
- const wxmlConfig = _nullishCoalesce(_optionalChain([ctx, 'access', _555 => _555.configService, 'access', _556 => _556.weappViteConfig, 'optionalAccess', _557 => _557.wxml]), () => ( _optionalChain([ctx, 'access', _558 => _558.configService, 'access', _559 => _559.weappViteConfig, 'optionalAccess', _560 => _560.enhance, 'optionalAccess', _561 => _561.wxml])));
30415
+ const wxmlConfig = _nullishCoalesce(_optionalChain([ctx, 'access', _563 => _563.configService, 'access', _564 => _564.weappViteConfig, 'optionalAccess', _565 => _565.wxml]), () => ( _optionalChain([ctx, 'access', _566 => _566.configService, 'access', _567 => _567.weappViteConfig, 'optionalAccess', _568 => _568.enhance, 'optionalAccess', _569 => _569.wxml])));
30234
30416
  return scanWxml(wxml, {
30235
30417
  platform: ctx.configService.platform,
30236
30418
  ...wxmlConfig === true ? {} : wxmlConfig