weapp-vite 5.9.4 → 5.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23638,6 +23638,7 @@ var watchedCssExts = new Set(supportedCssLangs.map((ext2) => `.${ext2}`));
23638
23638
  var watchedTemplateExts = new Set(templateExtensions.map((ext2) => `.${ext2}`));
23639
23639
  var configSuffixes = configExtensions.map((ext2) => `.${ext2}`);
23640
23640
  var sidecarSuffixes = [...configSuffixes, ...watchedCssExts, ...watchedTemplateExts];
23641
+ var defaultIgnoredDirNames = /* @__PURE__ */ new Set(["node_modules", "miniprogram_npm", ".git", ".hg", ".svn", ".turbo"]);
23641
23642
  var watchLimitErrorCodes = /* @__PURE__ */ new Set(["EMFILE", "ENOSPC"]);
23642
23643
  var importProtocols = /^(?:https?:|data:|blob:|\/)/i;
23643
23644
  var cssImportRE = /@(?:import|wv-keep-import)\s+(?:url\()?['"]?([^'")\s]+)['"]?\)?/gi;
@@ -23946,13 +23947,15 @@ function ensureSidecarWatcher(ctx, rootDir) {
23946
23947
  ...supportedCssLangs.map((ext2) => _pathe2.default.join(absRoot, `**/*.${ext2}`)),
23947
23948
  ...templateExtensions.map((ext2) => _pathe2.default.join(absRoot, `**/*.${ext2}`))
23948
23949
  ];
23950
+ const ignoredMatcher = createSidecarIgnoredMatcher(ctx, absRoot);
23949
23951
  const watcher = esm_default.watch(patterns, {
23950
23952
  ignoreInitial: false,
23951
23953
  persistent: true,
23952
23954
  awaitWriteFinish: {
23953
23955
  stabilityThreshold: 100,
23954
23956
  pollInterval: 20
23955
- }
23957
+ },
23958
+ ignored: ignoredMatcher
23956
23959
  });
23957
23960
  const forwardChange = (event, input, options) => {
23958
23961
  if (!input) {
@@ -23998,6 +24001,31 @@ function ensureSidecarWatcher(ctx, rootDir) {
23998
24001
  close: () => void watcher.close()
23999
24002
  });
24000
24003
  }
24004
+ function createSidecarIgnoredMatcher(ctx, rootDir) {
24005
+ const configService = ctx.configService;
24006
+ const ignoredRoots = /* @__PURE__ */ new Set();
24007
+ const normalizedRoot = _pathe2.default.normalize(rootDir);
24008
+ for (const dirName of defaultIgnoredDirNames) {
24009
+ ignoredRoots.add(_pathe2.default.join(normalizedRoot, dirName));
24010
+ }
24011
+ if (_optionalChain([configService, 'optionalAccess', _383 => _383.mpDistRoot])) {
24012
+ ignoredRoots.add(_pathe2.default.resolve(configService.cwd, configService.mpDistRoot));
24013
+ } else {
24014
+ ignoredRoots.add(_pathe2.default.join(normalizedRoot, "dist"));
24015
+ }
24016
+ if (_optionalChain([configService, 'optionalAccess', _384 => _384.outDir])) {
24017
+ ignoredRoots.add(_pathe2.default.resolve(configService.cwd, configService.outDir));
24018
+ }
24019
+ return (candidate) => {
24020
+ const normalized = _pathe2.default.normalize(candidate);
24021
+ for (const ignored of ignoredRoots) {
24022
+ if (normalized === ignored || normalized.startsWith(`${ignored}${_pathe2.default.sep}`)) {
24023
+ return true;
24024
+ }
24025
+ }
24026
+ return false;
24027
+ };
24028
+ }
24001
24029
 
24002
24030
  // src/plugins/utils/parse.ts
24003
24031
  _chunkFUIUGCNVcjs.init_cjs_shims.call(void 0, );
@@ -24155,7 +24183,7 @@ function createCacheKey(options) {
24155
24183
  return `${options.removeComment ? 1 : 0}|${options.transformEvent ? 1 : 0}`;
24156
24184
  }
24157
24185
  function getCachedResult(data2, cacheKey) {
24158
- return _optionalChain([handleCache, 'access', _383 => _383.get, 'call', _384 => _384(data2), 'optionalAccess', _385 => _385.get, 'call', _386 => _386(cacheKey)]);
24186
+ return _optionalChain([handleCache, 'access', _385 => _385.get, 'call', _386 => _386(data2), 'optionalAccess', _387 => _387.get, 'call', _388 => _388(cacheKey)]);
24159
24187
  }
24160
24188
  function setCachedResult(data2, cacheKey, result) {
24161
24189
  let cacheForToken = handleCache.get(data2);
@@ -24231,7 +24259,7 @@ function handleWxml(data2, options) {
24231
24259
  if (shouldTransformInlineWxs) {
24232
24260
  for (const { end, start, value } of inlineWxsTokens) {
24233
24261
  const { result } = getCachedInlineWxsTransform(value);
24234
- if (_optionalChain([result, 'optionalAccess', _387 => _387.code])) {
24262
+ if (_optionalChain([result, 'optionalAccess', _389 => _389.code])) {
24235
24263
  ms.update(start, end, `
24236
24264
  ${result.code}`);
24237
24265
  }
@@ -24282,11 +24310,11 @@ function emitWxmlAssetsWithCache(options) {
24282
24310
  });
24283
24311
  const emittedFiles = [];
24284
24312
  for (const { id, fileName, token } of currentPackageWxmls) {
24285
- _optionalChain([runtime, 'access', _388 => _388.addWatchFile, 'optionalCall', _389 => _389(id)]);
24313
+ _optionalChain([runtime, 'access', _390 => _390.addWatchFile, 'optionalCall', _391 => _391(id)]);
24286
24314
  const deps = wxmlService.depsMap.get(id);
24287
24315
  if (deps) {
24288
24316
  for (const dep of deps) {
24289
- _optionalChain([runtime, 'access', _390 => _390.addWatchFile, 'optionalCall', _391 => _391(dep)]);
24317
+ _optionalChain([runtime, 'access', _392 => _392.addWatchFile, 'optionalCall', _393 => _393(dep)]);
24290
24318
  }
24291
24319
  }
24292
24320
  emittedFiles.push(fileName);
@@ -24378,7 +24406,7 @@ function createTakeQueryPlugin(_state) {
24378
24406
  return null;
24379
24407
  }
24380
24408
  const resolved = await this.resolve(takeRequest.id, importer, { skipSelf: true });
24381
- if (_optionalChain([resolved, 'optionalAccess', _392 => _392.id])) {
24409
+ if (_optionalChain([resolved, 'optionalAccess', _394 => _394.id])) {
24382
24410
  markTakeModuleImporter(resolved.id, importer);
24383
24411
  if (takeRequest.legacy) {
24384
24412
  logger_default.warn(
@@ -24441,7 +24469,7 @@ function createCoreLifecyclePlugin(state) {
24441
24469
  buildService.invalidateIndependentOutput(independentRoot);
24442
24470
  scanService.markIndependentDirty(independentRoot);
24443
24471
  handledByIndependentWatcher = true;
24444
- if (_optionalChain([independentMeta, 'optionalAccess', _393 => _393.watchSharedStyles]) !== false) {
24472
+ if (_optionalChain([independentMeta, 'optionalAccess', _395 => _395.watchSharedStyles]) !== false) {
24445
24473
  invalidateSharedStyleCache();
24446
24474
  }
24447
24475
  }
@@ -24489,7 +24517,7 @@ function createCoreLifecyclePlugin(state) {
24489
24517
  options.input = scannedInput;
24490
24518
  },
24491
24519
  async load(id) {
24492
- _optionalChain([configService, 'access', _394 => _394.weappViteConfig, 'optionalAccess', _395 => _395.debug, 'optionalAccess', _396 => _396.load, 'optionalCall', _397 => _397(id, subPackageMeta)]);
24520
+ _optionalChain([configService, 'access', _396 => _396.weappViteConfig, 'optionalAccess', _397 => _397.debug, 'optionalAccess', _398 => _398.load, 'optionalCall', _399 => _399(id, subPackageMeta)]);
24493
24521
  const relativeBasename = _shared.removeExtensionDeep.call(void 0, configService.relativeAbsoluteSrcRoot(id));
24494
24522
  if (isCSSRequest(id)) {
24495
24523
  const parsed = parseRequest(id);
@@ -24503,7 +24531,7 @@ function createCoreLifecyclePlugin(state) {
24503
24531
  }
24504
24532
  return null;
24505
24533
  }
24506
- if (loadedEntrySet.has(id) || _optionalChain([subPackageMeta, 'optionalAccess', _398 => _398.entries, 'access', _399 => _399.includes, 'call', _400 => _400(relativeBasename)])) {
24534
+ if (loadedEntrySet.has(id) || _optionalChain([subPackageMeta, 'optionalAccess', _400 => _400.entries, 'access', _401 => _401.includes, 'call', _402 => _402(relativeBasename)])) {
24507
24535
  return await loadEntry.call(this, id, "component");
24508
24536
  }
24509
24537
  if (relativeBasename === "app") {
@@ -24534,10 +24562,10 @@ function createCoreLifecyclePlugin(state) {
24534
24562
  return subPackageRoots.find((root) => filePath === root || filePath.startsWith(`${root}/`));
24535
24563
  };
24536
24564
  var matchSubPackage = matchSubPackage2;
24537
- const sharedStrategy = _nullishCoalesce(_optionalChain([configService, 'access', _401 => _401.weappViteConfig, 'optionalAccess', _402 => _402.chunks, 'optionalAccess', _403 => _403.sharedStrategy]), () => ( DEFAULT_SHARED_CHUNK_STRATEGY));
24538
- const shouldLogChunks = _nullishCoalesce(_optionalChain([configService, 'access', _404 => _404.weappViteConfig, 'optionalAccess', _405 => _405.chunks, 'optionalAccess', _406 => _406.logOptimization]), () => ( true));
24565
+ const sharedStrategy = _nullishCoalesce(_optionalChain([configService, 'access', _403 => _403.weappViteConfig, 'optionalAccess', _404 => _404.chunks, 'optionalAccess', _405 => _405.sharedStrategy]), () => ( DEFAULT_SHARED_CHUNK_STRATEGY));
24566
+ const shouldLogChunks = _nullishCoalesce(_optionalChain([configService, 'access', _406 => _406.weappViteConfig, 'optionalAccess', _407 => _407.chunks, 'optionalAccess', _408 => _408.logOptimization]), () => ( true));
24539
24567
  const subPackageRoots = Array.from(scanService.subPackageMap.keys()).filter(Boolean);
24540
- const duplicateWarningBytes = Number(_nullishCoalesce(_optionalChain([configService, 'access', _407 => _407.weappViteConfig, 'optionalAccess', _408 => _408.chunks, 'optionalAccess', _409 => _409.duplicateWarningBytes]), () => ( 0)));
24568
+ const duplicateWarningBytes = Number(_nullishCoalesce(_optionalChain([configService, 'access', _409 => _409.weappViteConfig, 'optionalAccess', _410 => _410.chunks, 'optionalAccess', _411 => _411.duplicateWarningBytes]), () => ( 0)));
24541
24569
  const shouldWarnOnDuplicate = Number.isFinite(duplicateWarningBytes) && duplicateWarningBytes > 0;
24542
24570
  let redundantBytesTotal = 0;
24543
24571
  const handleDuplicate = shouldLogChunks || shouldWarnOnDuplicate ? ({ duplicates, ignoredMainImporters, chunkBytes, redundantBytes, retainedInMain, sharedFileName }) => {
@@ -24557,7 +24585,7 @@ function createCoreLifecyclePlugin(state) {
24557
24585
  }
24558
24586
  }
24559
24587
  const subPackageList = Array.from(subPackageSet).join("\u3001") || "\u76F8\u5173\u5206\u5305";
24560
- const ignoredHint = _optionalChain([ignoredMainImporters, 'optionalAccess', _410 => _410.length]) ? `\uFF0C\u5FFD\u7565\u4E3B\u5305\u5F15\u7528\uFF1A${ignoredMainImporters.join("\u3001")}` : "";
24588
+ const ignoredHint = _optionalChain([ignoredMainImporters, 'optionalAccess', _412 => _412.length]) ? `\uFF0C\u5FFD\u7565\u4E3B\u5305\u5F15\u7528\uFF1A${ignoredMainImporters.join("\u3001")}` : "";
24561
24589
  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`);
24562
24590
  if (retainedInMain) {
24563
24591
  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`);
@@ -24602,10 +24630,10 @@ function createCoreLifecyclePlugin(state) {
24602
24630
  configService,
24603
24631
  entriesMap: state.entriesMap
24604
24632
  });
24605
- if (_optionalChain([configService, 'access', _411 => _411.weappViteConfig, 'optionalAccess', _412 => _412.debug, 'optionalAccess', _413 => _413.watchFiles])) {
24633
+ if (_optionalChain([configService, 'access', _413 => _413.weappViteConfig, 'optionalAccess', _414 => _414.debug, 'optionalAccess', _415 => _415.watchFiles])) {
24606
24634
  const watcherService = ctx.watcherService;
24607
- const watcherRoot = _nullishCoalesce(_optionalChain([subPackageMeta, 'optionalAccess', _414 => _414.subPackage, 'access', _415 => _415.root]), () => ( "/"));
24608
- const watcher = _optionalChain([watcherService, 'optionalAccess', _416 => _416.getRollupWatcher, 'call', _417 => _417(watcherRoot)]);
24635
+ const watcherRoot = _nullishCoalesce(_optionalChain([subPackageMeta, 'optionalAccess', _416 => _416.subPackage, 'access', _417 => _417.root]), () => ( "/"));
24636
+ const watcher = _optionalChain([watcherService, 'optionalAccess', _418 => _418.getRollupWatcher, 'call', _419 => _419(watcherRoot)]);
24609
24637
  let watchFiles;
24610
24638
  if (watcher && typeof watcher.getWatchFiles === "function") {
24611
24639
  watchFiles = await watcher.getWatchFiles();
@@ -24619,7 +24647,7 @@ function createCoreLifecyclePlugin(state) {
24619
24647
  }
24620
24648
  },
24621
24649
  buildEnd() {
24622
- _optionalChain([debug2, 'optionalCall', _418 => _418(`${subPackageMeta ? `\u72EC\u7ACB\u5206\u5305 ${subPackageMeta.subPackage.root}` : "\u4E3B\u5305"} ${Array.from(this.getModuleIds()).length} \u4E2A\u6A21\u5757\u88AB\u7F16\u8BD1`)]);
24650
+ _optionalChain([debug2, 'optionalCall', _420 => _420(`${subPackageMeta ? `\u72EC\u7ACB\u5206\u5305 ${subPackageMeta.subPackage.root}` : "\u4E3B\u5305"} ${Array.from(this.getModuleIds()).length} \u4E2A\u6A21\u5757\u88AB\u7F16\u8BD1`)]);
24623
24651
  }
24624
24652
  };
24625
24653
  }
@@ -24811,7 +24839,7 @@ async function flushIndependentBuilds(state) {
24811
24839
  }
24812
24840
  const outputs = await Promise.all(pendingIndependentBuilds);
24813
24841
  for (const { rollup } of outputs) {
24814
- const bundleOutputs = Array.isArray(_optionalChain([rollup, 'optionalAccess', _419 => _419.output])) ? rollup.output : [];
24842
+ const bundleOutputs = Array.isArray(_optionalChain([rollup, 'optionalAccess', _421 => _421.output])) ? rollup.output : [];
24815
24843
  for (const output of bundleOutputs) {
24816
24844
  if (output.type === "chunk") {
24817
24845
  this.emitFile({
@@ -24848,13 +24876,13 @@ function toPosixPath(value) {
24848
24876
  var styleMatcherCache = /* @__PURE__ */ new WeakMap();
24849
24877
  function collectSharedStyleEntries(ctx, configService) {
24850
24878
  const map = /* @__PURE__ */ new Map();
24851
- const registry = _optionalChain([ctx, 'access', _420 => _420.scanService, 'optionalAccess', _421 => _421.subPackageMap]);
24852
- if (!_optionalChain([registry, 'optionalAccess', _422 => _422.size])) {
24879
+ const registry = _optionalChain([ctx, 'access', _422 => _422.scanService, 'optionalAccess', _423 => _423.subPackageMap]);
24880
+ if (!_optionalChain([registry, 'optionalAccess', _424 => _424.size])) {
24853
24881
  return map;
24854
24882
  }
24855
24883
  const currentRoot = configService.currentSubPackageRoot;
24856
24884
  for (const [root, meta] of registry.entries()) {
24857
- if (!_optionalChain([meta, 'access', _423 => _423.styleEntries, 'optionalAccess', _424 => _424.length])) {
24885
+ if (!_optionalChain([meta, 'access', _425 => _425.styleEntries, 'optionalAccess', _426 => _426.length])) {
24858
24886
  continue;
24859
24887
  }
24860
24888
  if (currentRoot && root !== currentRoot) {
@@ -24899,12 +24927,12 @@ function getStyleMatcher(entry) {
24899
24927
  if (cached) {
24900
24928
  return cached;
24901
24929
  }
24902
- const includePatterns = _optionalChain([entry, 'access', _425 => _425.include, 'optionalAccess', _426 => _426.length]) ? entry.include : ["**/*"];
24903
- const excludePatterns = _optionalChain([entry, 'access', _427 => _427.exclude, 'optionalAccess', _428 => _428.length]) ? entry.exclude : void 0;
24930
+ const includePatterns = _optionalChain([entry, 'access', _427 => _427.include, 'optionalAccess', _428 => _428.length]) ? entry.include : ["**/*"];
24931
+ const excludePatterns = _optionalChain([entry, 'access', _429 => _429.exclude, 'optionalAccess', _430 => _430.length]) ? entry.exclude : void 0;
24904
24932
  const matcher = {
24905
24933
  include: _picomatch2.default.call(void 0, includePatterns, { dot: true })
24906
24934
  };
24907
- if (_optionalChain([excludePatterns, 'optionalAccess', _429 => _429.length])) {
24935
+ if (_optionalChain([excludePatterns, 'optionalAccess', _431 => _431.length])) {
24908
24936
  matcher.exclude = _picomatch2.default.call(void 0, excludePatterns, { dot: true });
24909
24937
  }
24910
24938
  styleMatcherCache.set(entry, matcher);
@@ -25009,7 +25037,7 @@ function injectSharedStyleImports(css2, modulePath, fileName, sharedStyles, conf
25009
25037
  }
25010
25038
  const normalizedFileName = toPosixPath(fileName);
25011
25039
  const entries = findSharedStylesForModule(normalizedModule, normalizedFileName, sharedStyles);
25012
- if (!_optionalChain([entries, 'optionalAccess', _430 => _430.length])) {
25040
+ if (!_optionalChain([entries, 'optionalAccess', _432 => _432.length])) {
25013
25041
  return css2;
25014
25042
  }
25015
25043
  const specifiers = resolveImportSpecifiers(fileName, entries);
@@ -25221,14 +25249,14 @@ function createPluginPruner() {
25221
25249
  name: "weapp-vite:preflight",
25222
25250
  enforce: "pre",
25223
25251
  configResolved(config) {
25224
- if (!_optionalChain([config, 'access', _431 => _431.plugins, 'optionalAccess', _432 => _432.length])) {
25252
+ if (!_optionalChain([config, 'access', _433 => _433.plugins, 'optionalAccess', _434 => _434.length])) {
25225
25253
  return;
25226
25254
  }
25227
25255
  for (const removePlugin of removePlugins) {
25228
25256
  const idx = config.plugins.findIndex((plugin) => plugin.name === removePlugin);
25229
25257
  if (idx > -1) {
25230
25258
  const [plugin] = config.plugins.splice(idx, 1);
25231
- plugin && _optionalChain([debug3, 'optionalCall', _433 => _433("remove plugin", plugin.name)]);
25259
+ plugin && _optionalChain([debug3, 'optionalCall', _435 => _435("remove plugin", plugin.name)]);
25232
25260
  }
25233
25261
  }
25234
25262
  }
@@ -25284,8 +25312,8 @@ function createWorkerBuildPlugin(ctx) {
25284
25312
  name: "weapp-vite:workers",
25285
25313
  enforce: "pre",
25286
25314
  async options(options) {
25287
- const workerConfig = _optionalChain([configService, 'access', _434 => _434.weappViteConfig, 'optionalAccess', _435 => _435.worker]);
25288
- const entries = Array.isArray(_optionalChain([workerConfig, 'optionalAccess', _436 => _436.entry])) ? workerConfig.entry : [_optionalChain([workerConfig, 'optionalAccess', _437 => _437.entry])];
25315
+ const workerConfig = _optionalChain([configService, 'access', _436 => _436.weappViteConfig, 'optionalAccess', _437 => _437.worker]);
25316
+ const entries = Array.isArray(_optionalChain([workerConfig, 'optionalAccess', _438 => _438.entry])) ? workerConfig.entry : [_optionalChain([workerConfig, 'optionalAccess', _439 => _439.entry])];
25289
25317
  const normalized = (await Promise.all(entries.filter(Boolean).map((entry) => resolveWorkerEntry(ctx, entry)))).filter((result) => Boolean(result.value)).reduce((acc, cur) => {
25290
25318
  acc[cur.key] = cur.value;
25291
25319
  return acc;
@@ -25342,7 +25370,7 @@ async function transformWxsFile(state, wxsPath) {
25342
25370
  const { result, importees } = transformWxsCode(rawCode, {
25343
25371
  filename: wxsPath
25344
25372
  });
25345
- if (typeof _optionalChain([result, 'optionalAccess', _438 => _438.code]) === "string") {
25373
+ if (typeof _optionalChain([result, 'optionalAccess', _440 => _440.code]) === "string") {
25346
25374
  code = result.code;
25347
25375
  }
25348
25376
  const dirname5 = _pathe2.default.dirname(wxsPath);
@@ -25431,13 +25459,13 @@ function createContextPlugin(ctx) {
25431
25459
  }
25432
25460
  function attachRuntimePlugins(ctx, plugins) {
25433
25461
  const runtimePlugins = ctx[RUNTIME_PLUGINS_SYMBOL];
25434
- if (!_optionalChain([runtimePlugins, 'optionalAccess', _439 => _439.length])) {
25462
+ if (!_optionalChain([runtimePlugins, 'optionalAccess', _441 => _441.length])) {
25435
25463
  return plugins;
25436
25464
  }
25437
25465
  return [...runtimePlugins, ...plugins];
25438
25466
  }
25439
25467
  function applyInspect(ctx, plugins) {
25440
- const inspectOptions = _optionalChain([ctx, 'access', _440 => _440.configService, 'access', _441 => _441.weappViteConfig, 'optionalAccess', _442 => _442.debug, 'optionalAccess', _443 => _443.inspect]);
25468
+ const inspectOptions = _optionalChain([ctx, 'access', _442 => _442.configService, 'access', _443 => _443.weappViteConfig, 'optionalAccess', _444 => _444.debug, 'optionalAccess', _445 => _445.inspect]);
25441
25469
  if (!inspectOptions) {
25442
25470
  return plugins;
25443
25471
  }
@@ -25568,7 +25596,7 @@ function createMergeFactories(options) {
25568
25596
  const currentOptions = getOptions2();
25569
25597
  applyRuntimePlatform("miniprogram");
25570
25598
  const external = [];
25571
- if (_optionalChain([currentOptions, 'access', _444 => _444.packageJson, 'optionalAccess', _445 => _445.dependencies])) {
25599
+ if (_optionalChain([currentOptions, 'access', _446 => _446.packageJson, 'optionalAccess', _447 => _447.dependencies])) {
25572
25600
  external.push(
25573
25601
  ...Object.keys(currentOptions.packageJson.dependencies).map((pkg) => {
25574
25602
  return new RegExp(`^${pkg.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&")}(\\/|$)`);
@@ -25583,7 +25611,7 @@ function createMergeFactories(options) {
25583
25611
  const watchInclude = [
25584
25612
  _pathe2.default.join(currentOptions.cwd, currentOptions.srcRoot, "**")
25585
25613
  ];
25586
- const pluginRootConfig = _optionalChain([currentOptions, 'access', _446 => _446.config, 'access', _447 => _447.weapp, 'optionalAccess', _448 => _448.pluginRoot]);
25614
+ const pluginRootConfig = _optionalChain([currentOptions, 'access', _448 => _448.config, 'access', _449 => _449.weapp, 'optionalAccess', _450 => _450.pluginRoot]);
25587
25615
  if (pluginRootConfig) {
25588
25616
  const absolutePluginRoot = _pathe2.default.resolve(currentOptions.cwd, pluginRootConfig);
25589
25617
  const relativeToSrc = _pathe2.default.relative(
@@ -25641,7 +25669,7 @@ function createMergeFactories(options) {
25641
25669
  arrangePlugins(inlineConfig, subPackageMeta);
25642
25670
  inlineConfig.logLevel = "info";
25643
25671
  injectBuiltinAliases(inlineConfig);
25644
- const currentRoot = _optionalChain([subPackageMeta, 'optionalAccess', _449 => _449.subPackage, 'access', _450 => _450.root]);
25672
+ const currentRoot = _optionalChain([subPackageMeta, 'optionalAccess', _451 => _451.subPackage, 'access', _452 => _452.root]);
25645
25673
  setOptions({
25646
25674
  ...currentOptions,
25647
25675
  currentSubPackageRoot: currentRoot
@@ -25652,7 +25680,7 @@ function createMergeFactories(options) {
25652
25680
  ensureConfigService();
25653
25681
  const currentOptions = getOptions2();
25654
25682
  const web = currentOptions.weappWeb;
25655
- if (!_optionalChain([web, 'optionalAccess', _451 => _451.enabled])) {
25683
+ if (!_optionalChain([web, 'optionalAccess', _453 => _453.enabled])) {
25656
25684
  return void 0;
25657
25685
  }
25658
25686
  applyRuntimePlatform("web");
@@ -25743,7 +25771,7 @@ function createConfigService(ctx) {
25743
25771
  defineEnv[key] = value;
25744
25772
  }
25745
25773
  function getDefineImportMetaEnv() {
25746
- const mpPlatform = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _452 => _452.platform]), () => ( DEFAULT_MP_PLATFORM));
25774
+ const mpPlatform = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _454 => _454.platform]), () => ( DEFAULT_MP_PLATFORM));
25747
25775
  const resolvedPlatform = _nullishCoalesce(defineEnv.PLATFORM, () => ( mpPlatform));
25748
25776
  const env = {
25749
25777
  PLATFORM: resolvedPlatform,
@@ -25759,7 +25787,7 @@ function createConfigService(ctx) {
25759
25787
  }
25760
25788
  function applyRuntimePlatform(runtime) {
25761
25789
  const isWeb = runtime === "web";
25762
- const mpPlatform = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _453 => _453.platform]), () => ( DEFAULT_MP_PLATFORM));
25790
+ const mpPlatform = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _455 => _455.platform]), () => ( DEFAULT_MP_PLATFORM));
25763
25791
  const resolvedPlatform = isWeb ? "web" : mpPlatform;
25764
25792
  setDefineEnv("PLATFORM", resolvedPlatform);
25765
25793
  setDefineEnv("IS_WEB", isWeb);
@@ -25870,10 +25898,10 @@ function createConfigService(ctx) {
25870
25898
  return options.srcRoot;
25871
25899
  },
25872
25900
  get pluginRoot() {
25873
- return _optionalChain([options, 'access', _454 => _454.config, 'access', _455 => _455.weapp, 'optionalAccess', _456 => _456.pluginRoot]);
25901
+ return _optionalChain([options, 'access', _456 => _456.config, 'access', _457 => _457.weapp, 'optionalAccess', _458 => _458.pluginRoot]);
25874
25902
  },
25875
25903
  get absolutePluginRoot() {
25876
- if (_optionalChain([options, 'access', _457 => _457.config, 'access', _458 => _458.weapp, 'optionalAccess', _459 => _459.pluginRoot])) {
25904
+ if (_optionalChain([options, 'access', _459 => _459.config, 'access', _460 => _460.weapp, 'optionalAccess', _461 => _461.pluginRoot])) {
25877
25905
  return _pathe2.default.resolve(options.cwd, options.config.weapp.pluginRoot);
25878
25906
  }
25879
25907
  },
@@ -25903,7 +25931,7 @@ function createConfigService(ctx) {
25903
25931
  },
25904
25932
  relativeAbsoluteSrcRoot(p) {
25905
25933
  const absoluteSrcRoot = _pathe2.default.resolve(options.cwd, options.srcRoot);
25906
- const pluginRootConfig = _optionalChain([options, 'access', _460 => _460.config, 'access', _461 => _461.weapp, 'optionalAccess', _462 => _462.pluginRoot]);
25934
+ const pluginRootConfig = _optionalChain([options, 'access', _462 => _462.config, 'access', _463 => _463.weapp, 'optionalAccess', _464 => _464.pluginRoot]);
25907
25935
  if (pluginRootConfig) {
25908
25936
  const absolutePluginRoot = _pathe2.default.resolve(options.cwd, pluginRootConfig);
25909
25937
  const relativeToPlugin = _pathe2.default.relative(absolutePluginRoot, p);
@@ -25955,10 +25983,10 @@ function createJsonService(ctx) {
25955
25983
  }
25956
25984
  let resultJson;
25957
25985
  if (/app\.json(?:\.[jt]s)?$/.test(filepath)) {
25958
- await _optionalChain([ctx, 'access', _463 => _463.autoRoutesService, 'optionalAccess', _464 => _464.ensureFresh, 'call', _465 => _465()]);
25986
+ await _optionalChain([ctx, 'access', _465 => _465.autoRoutesService, 'optionalAccess', _466 => _466.ensureFresh, 'call', _467 => _467()]);
25959
25987
  }
25960
25988
  if (/\.json\.[jt]s$/.test(filepath)) {
25961
- const routesReference = _optionalChain([ctx, 'access', _466 => _466.autoRoutesService, 'optionalAccess', _467 => _467.getReference, 'call', _468 => _468()]);
25989
+ const routesReference = _optionalChain([ctx, 'access', _468 => _468.autoRoutesService, 'optionalAccess', _469 => _469.getReference, 'call', _470 => _470()]);
25962
25990
  const fallbackRoutes = _nullishCoalesce(routesReference, () => ( { pages: [], entries: [], subPackages: [] }));
25963
25991
  const routesModule = {
25964
25992
  routes: fallbackRoutes,
@@ -26007,7 +26035,7 @@ function createJsonService(ctx) {
26007
26035
  return resultJson;
26008
26036
  } catch (error) {
26009
26037
  logger_default.error(`\u6B8B\u7834\u7684JSON\u6587\u4EF6: ${filepath}`);
26010
- _optionalChain([debug, 'optionalCall', _469 => _469(error)]);
26038
+ _optionalChain([debug, 'optionalCall', _471 => _471(error)]);
26011
26039
  }
26012
26040
  }
26013
26041
  function resolve8(entry) {
@@ -26062,7 +26090,7 @@ function createNpmService(ctx) {
26062
26090
  if (!ctx.configService) {
26063
26091
  throw new Error("configService must be initialized before writing npm cache");
26064
26092
  }
26065
- if (_optionalChain([ctx, 'access', _470 => _470.configService, 'access', _471 => _471.weappViteConfig, 'optionalAccess', _472 => _472.npm, 'optionalAccess', _473 => _473.cache])) {
26093
+ if (_optionalChain([ctx, 'access', _472 => _472.configService, 'access', _473 => _473.weappViteConfig, 'optionalAccess', _474 => _474.npm, 'optionalAccess', _475 => _475.cache])) {
26066
26094
  await _fsextra2.default.outputJSON(getDependenciesCacheFilePath(root), {
26067
26095
  hash: dependenciesCacheHash()
26068
26096
  });
@@ -26075,7 +26103,7 @@ function createNpmService(ctx) {
26075
26103
  }
26076
26104
  }
26077
26105
  async function checkDependenciesCacheOutdate(root) {
26078
- if (_optionalChain([ctx, 'access', _474 => _474.configService, 'optionalAccess', _475 => _475.weappViteConfig, 'optionalAccess', _476 => _476.npm, 'optionalAccess', _477 => _477.cache])) {
26106
+ if (_optionalChain([ctx, 'access', _476 => _476.configService, 'optionalAccess', _477 => _477.weappViteConfig, 'optionalAccess', _478 => _478.npm, 'optionalAccess', _479 => _479.cache])) {
26079
26107
  const json = await readDependenciesCache(root);
26080
26108
  if (_shared.isObject.call(void 0, json)) {
26081
26109
  return dependenciesCacheHash() !== json.hash;
@@ -26108,7 +26136,7 @@ function createNpmService(ctx) {
26108
26136
  target: "es6",
26109
26137
  external: []
26110
26138
  });
26111
- const resolvedOptions = _optionalChain([ctx, 'access', _478 => _478.configService, 'optionalAccess', _479 => _479.weappViteConfig, 'optionalAccess', _480 => _480.npm, 'optionalAccess', _481 => _481.buildOptions, 'optionalCall', _482 => _482(
26139
+ const resolvedOptions = _optionalChain([ctx, 'access', _480 => _480.configService, 'optionalAccess', _481 => _481.weappViteConfig, 'optionalAccess', _482 => _482.npm, 'optionalAccess', _483 => _483.buildOptions, 'optionalCall', _484 => _484(
26112
26140
  mergedOptions,
26113
26141
  { name, entry }
26114
26142
  )]);
@@ -26208,7 +26236,7 @@ function createNpmService(ctx) {
26208
26236
  throw new Error("configService must be initialized before resolving npm relation list");
26209
26237
  }
26210
26238
  let packNpmRelationList = [];
26211
- if (_optionalChain([ctx, 'access', _483 => _483.configService, 'access', _484 => _484.projectConfig, 'access', _485 => _485.setting, 'optionalAccess', _486 => _486.packNpmManually]) && Array.isArray(ctx.configService.projectConfig.setting.packNpmRelationList)) {
26239
+ if (_optionalChain([ctx, 'access', _485 => _485.configService, 'access', _486 => _486.projectConfig, 'access', _487 => _487.setting, 'optionalAccess', _488 => _488.packNpmManually]) && Array.isArray(ctx.configService.projectConfig.setting.packNpmRelationList)) {
26212
26240
  packNpmRelationList = ctx.configService.projectConfig.setting.packNpmRelationList;
26213
26241
  } else {
26214
26242
  packNpmRelationList = [
@@ -26221,10 +26249,10 @@ function createNpmService(ctx) {
26221
26249
  return packNpmRelationList;
26222
26250
  }
26223
26251
  async function build3(options) {
26224
- if (!_optionalChain([ctx, 'access', _487 => _487.configService, 'optionalAccess', _488 => _488.weappViteConfig, 'optionalAccess', _489 => _489.npm, 'optionalAccess', _490 => _490.enable])) {
26252
+ if (!_optionalChain([ctx, 'access', _489 => _489.configService, 'optionalAccess', _490 => _490.weappViteConfig, 'optionalAccess', _491 => _491.npm, 'optionalAccess', _492 => _492.enable])) {
26225
26253
  return;
26226
26254
  }
26227
- _optionalChain([debug, 'optionalCall', _491 => _491("buildNpm start")]);
26255
+ _optionalChain([debug, 'optionalCall', _493 => _493("buildNpm start")]);
26228
26256
  const packNpmRelationList = getPackNpmRelationList();
26229
26257
  const [mainRelation, ...subRelations] = packNpmRelationList;
26230
26258
  const packageJsonPath = _pathe2.default.resolve(ctx.configService.cwd, mainRelation.packageJsonPath);
@@ -26299,7 +26327,7 @@ function createNpmService(ctx) {
26299
26327
  }
26300
26328
  }
26301
26329
  }
26302
- _optionalChain([debug, 'optionalCall', _492 => _492("buildNpm end")]);
26330
+ _optionalChain([debug, 'optionalCall', _494 => _494("buildNpm end")]);
26303
26331
  }
26304
26332
  return {
26305
26333
  getDependenciesCacheFilePath,
@@ -26330,20 +26358,20 @@ function createNpmServicePlugin(ctx) {
26330
26358
  _chunkFUIUGCNVcjs.init_cjs_shims.call(void 0, );
26331
26359
 
26332
26360
 
26333
- // ../../node_modules/.pnpm/p-queue@9.0.0/node_modules/p-queue/dist/index.js
26361
+ // ../../node_modules/.pnpm/p-queue@9.0.1/node_modules/p-queue/dist/index.js
26334
26362
  _chunkFUIUGCNVcjs.init_cjs_shims.call(void 0, );
26335
26363
 
26336
26364
  // ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.mjs
26337
26365
  _chunkFUIUGCNVcjs.init_cjs_shims.call(void 0, );
26338
26366
  var import_index2 = _chunkFUIUGCNVcjs.__toESM.call(void 0, require_eventemitter3(), 1);
26339
26367
 
26340
- // ../../node_modules/.pnpm/p-timeout@7.0.0/node_modules/p-timeout/index.js
26368
+ // ../../node_modules/.pnpm/p-timeout@7.0.1/node_modules/p-timeout/index.js
26341
26369
  _chunkFUIUGCNVcjs.init_cjs_shims.call(void 0, );
26342
26370
  var TimeoutError = (_class16 = class _TimeoutError extends Error {
26343
26371
  __init36() {this.name = "TimeoutError"}
26344
26372
  constructor(message, options) {
26345
26373
  super(message, options);_class16.prototype.__init36.call(this);;
26346
- _optionalChain([Error, 'access', _493 => _493.captureStackTrace, 'optionalCall', _494 => _494(this, _TimeoutError)]);
26374
+ _optionalChain([Error, 'access', _495 => _495.captureStackTrace, 'optionalCall', _496 => _496(this, _TimeoutError)]);
26347
26375
  }
26348
26376
  }, _class16);
26349
26377
  var getAbortedReason = (signal) => _nullishCoalesce(signal.reason, () => ( new DOMException("This operation was aborted.", "AbortError")));
@@ -26361,7 +26389,7 @@ function pTimeout(promise, options) {
26361
26389
  if (typeof milliseconds !== "number" || Math.sign(milliseconds) !== 1) {
26362
26390
  throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${milliseconds}\``);
26363
26391
  }
26364
- if (_optionalChain([signal, 'optionalAccess', _495 => _495.aborted])) {
26392
+ if (_optionalChain([signal, 'optionalAccess', _497 => _497.aborted])) {
26365
26393
  reject(getAbortedReason(signal));
26366
26394
  return;
26367
26395
  }
@@ -26376,7 +26404,7 @@ function pTimeout(promise, options) {
26376
26404
  return;
26377
26405
  }
26378
26406
  const timeoutError = new TimeoutError();
26379
- timer = customTimers.setTimeout(() => {
26407
+ timer = customTimers.setTimeout.call(void 0, () => {
26380
26408
  if (fallback) {
26381
26409
  try {
26382
26410
  resolve8(fallback());
@@ -26405,16 +26433,16 @@ function pTimeout(promise, options) {
26405
26433
  }
26406
26434
  });
26407
26435
  cancelablePromise.clear = () => {
26408
- customTimers.clearTimeout(timer);
26436
+ customTimers.clearTimeout.call(void 0, timer);
26409
26437
  timer = void 0;
26410
26438
  };
26411
26439
  return cancelablePromise;
26412
26440
  }
26413
26441
 
26414
- // ../../node_modules/.pnpm/p-queue@9.0.0/node_modules/p-queue/dist/priority-queue.js
26442
+ // ../../node_modules/.pnpm/p-queue@9.0.1/node_modules/p-queue/dist/priority-queue.js
26415
26443
  _chunkFUIUGCNVcjs.init_cjs_shims.call(void 0, );
26416
26444
 
26417
- // ../../node_modules/.pnpm/p-queue@9.0.0/node_modules/p-queue/dist/lower-bound.js
26445
+ // ../../node_modules/.pnpm/p-queue@9.0.1/node_modules/p-queue/dist/lower-bound.js
26418
26446
  _chunkFUIUGCNVcjs.init_cjs_shims.call(void 0, );
26419
26447
  function lowerBound(array, value, comparator) {
26420
26448
  let first = 0;
@@ -26432,7 +26460,7 @@ function lowerBound(array, value, comparator) {
26432
26460
  return first;
26433
26461
  }
26434
26462
 
26435
- // ../../node_modules/.pnpm/p-queue@9.0.0/node_modules/p-queue/dist/priority-queue.js
26463
+ // ../../node_modules/.pnpm/p-queue@9.0.1/node_modules/p-queue/dist/priority-queue.js
26436
26464
  var PriorityQueue = class {
26437
26465
  #queue = [];
26438
26466
  enqueue(run, options) {
@@ -26459,7 +26487,7 @@ var PriorityQueue = class {
26459
26487
  }
26460
26488
  dequeue() {
26461
26489
  const item = this.#queue.shift();
26462
- return _optionalChain([item, 'optionalAccess', _496 => _496.run]);
26490
+ return _optionalChain([item, 'optionalAccess', _498 => _498.run]);
26463
26491
  }
26464
26492
  filter(options) {
26465
26493
  return this.#queue.filter((element) => element.priority === options.priority).map((element) => element.run);
@@ -26469,7 +26497,7 @@ var PriorityQueue = class {
26469
26497
  }
26470
26498
  };
26471
26499
 
26472
- // ../../node_modules/.pnpm/p-queue@9.0.0/node_modules/p-queue/dist/index.js
26500
+ // ../../node_modules/.pnpm/p-queue@9.0.1/node_modules/p-queue/dist/index.js
26473
26501
  var PQueue = class extends import_index2.default {
26474
26502
  #carryoverIntervalCount;
26475
26503
  #isIntervalIgnored;
@@ -26520,10 +26548,10 @@ var PQueue = class extends import_index2.default {
26520
26548
  ...options
26521
26549
  };
26522
26550
  if (!(typeof options.intervalCap === "number" && options.intervalCap >= 1)) {
26523
- throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${_nullishCoalesce(_optionalChain([options, 'access', _497 => _497.intervalCap, 'optionalAccess', _498 => _498.toString, 'call', _499 => _499()]), () => ( ""))}\` (${typeof options.intervalCap})`);
26551
+ throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${_nullishCoalesce(_optionalChain([options, 'access', _499 => _499.intervalCap, 'optionalAccess', _500 => _500.toString, 'call', _501 => _501()]), () => ( ""))}\` (${typeof options.intervalCap})`);
26524
26552
  }
26525
26553
  if (options.interval === void 0 || !(Number.isFinite(options.interval) && options.interval >= 0)) {
26526
- throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${_nullishCoalesce(_optionalChain([options, 'access', _500 => _500.interval, 'optionalAccess', _501 => _501.toString, 'call', _502 => _502()]), () => ( ""))}\` (${typeof options.interval})`);
26554
+ throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${_nullishCoalesce(_optionalChain([options, 'access', _502 => _502.interval, 'optionalAccess', _503 => _503.toString, 'call', _504 => _504()]), () => ( ""))}\` (${typeof options.interval})`);
26527
26555
  }
26528
26556
  this.#carryoverIntervalCount = _nullishCoalesce(_nullishCoalesce(options.carryoverIntervalCount, () => ( options.carryoverConcurrencyCount)), () => ( false));
26529
26557
  this.#isIntervalIgnored = options.intervalCap === Number.POSITIVE_INFINITY || options.interval === 0;
@@ -26662,13 +26690,6 @@ var PQueue = class extends import_index2.default {
26662
26690
  this.#concurrency = newConcurrency;
26663
26691
  this.#processQueue();
26664
26692
  }
26665
- async #throwOnAbort(signal) {
26666
- return new Promise((_resolve3, reject) => {
26667
- signal.addEventListener("abort", () => {
26668
- reject(signal.reason);
26669
- }, { once: true });
26670
- });
26671
- }
26672
26693
  /**
26673
26694
  Updates the priority of a promise function by its id, affecting its execution order. Requires a defined concurrency limit to take effect.
26674
26695
 
@@ -26728,9 +26749,10 @@ var PQueue = class extends import_index2.default {
26728
26749
  startTime: Date.now(),
26729
26750
  timeout: options.timeout
26730
26751
  });
26752
+ let eventListener;
26731
26753
  try {
26732
26754
  try {
26733
- _optionalChain([options, 'access', _503 => _503.signal, 'optionalAccess', _504 => _504.throwIfAborted, 'call', _505 => _505()]);
26755
+ _optionalChain([options, 'access', _505 => _505.signal, 'optionalAccess', _506 => _506.throwIfAborted, 'call', _507 => _507()]);
26734
26756
  } catch (error) {
26735
26757
  if (!this.#isIntervalIgnored) {
26736
26758
  this.#intervalCount--;
@@ -26746,7 +26768,13 @@ var PQueue = class extends import_index2.default {
26746
26768
  });
26747
26769
  }
26748
26770
  if (options.signal) {
26749
- operation = Promise.race([operation, this.#throwOnAbort(options.signal)]);
26771
+ const { signal } = options;
26772
+ operation = Promise.race([operation, new Promise((_resolve3, reject2) => {
26773
+ eventListener = () => {
26774
+ reject2(signal.reason);
26775
+ };
26776
+ signal.addEventListener("abort", eventListener, { once: true });
26777
+ })]);
26750
26778
  }
26751
26779
  const result = await operation;
26752
26780
  resolve8(result);
@@ -26755,6 +26783,9 @@ var PQueue = class extends import_index2.default {
26755
26783
  reject(error);
26756
26784
  this.emit("error", error);
26757
26785
  } finally {
26786
+ if (eventListener) {
26787
+ _optionalChain([options, 'access', _508 => _508.signal, 'optionalAccess', _509 => _509.removeEventListener, 'call', _510 => _510("abort", eventListener)]);
26788
+ }
26758
26789
  this.#runningTasks.delete(taskSymbol);
26759
26790
  queueMicrotask(() => {
26760
26791
  this.#next();
@@ -27103,7 +27134,7 @@ var FileCache = class {
27103
27134
  return true;
27104
27135
  }
27105
27136
  const cachedMtime = this.mtimeMap.get(id);
27106
- const nextSignature = _optionalChain([options, 'optionalAccess', _506 => _506.content]) !== void 0 ? createSignature(options.content) : void 0;
27137
+ const nextSignature = _optionalChain([options, 'optionalAccess', _511 => _511.content]) !== void 0 ? createSignature(options.content) : void 0;
27107
27138
  const updateSignature = () => {
27108
27139
  if (nextSignature !== void 0) {
27109
27140
  this.signatureMap.set(id, nextSignature);
@@ -27338,7 +27369,7 @@ function coerceStyleConfig(entry) {
27338
27369
  if (!entry || typeof entry !== "object") {
27339
27370
  return void 0;
27340
27371
  }
27341
- const source = _optionalChain([entry, 'access', _507 => _507.source, 'optionalAccess', _508 => _508.toString, 'call', _509 => _509(), 'access', _510 => _510.trim, 'call', _511 => _511()]);
27372
+ const source = _optionalChain([entry, 'access', _512 => _512.source, 'optionalAccess', _513 => _513.toString, 'call', _514 => _514(), 'access', _515 => _515.trim, 'call', _516 => _516()]);
27342
27373
  if (!source) {
27343
27374
  return void 0;
27344
27375
  }
@@ -27514,7 +27545,7 @@ function normalizeSubPackageStyleEntries(styles, subPackage, configService) {
27514
27545
  if (!service) {
27515
27546
  return void 0;
27516
27547
  }
27517
- const root = _optionalChain([subPackage, 'access', _512 => _512.root, 'optionalAccess', _513 => _513.trim, 'call', _514 => _514()]);
27548
+ const root = _optionalChain([subPackage, 'access', _517 => _517.root, 'optionalAccess', _518 => _518.trim, 'call', _519 => _519()]);
27518
27549
  if (!root) {
27519
27550
  return void 0;
27520
27551
  }
@@ -27622,7 +27653,7 @@ function createScanService(ctx) {
27622
27653
  if (!ctx.configService) {
27623
27654
  throw new Error("configService must be initialized before scanning subpackages");
27624
27655
  }
27625
- const json = _optionalChain([scanState, 'access', _515 => _515.appEntry, 'optionalAccess', _516 => _516.json]);
27656
+ const json = _optionalChain([scanState, 'access', _520 => _520.appEntry, 'optionalAccess', _521 => _521.json]);
27626
27657
  if (scanState.isDirty || subPackageMap.size === 0) {
27627
27658
  subPackageMap.clear();
27628
27659
  independentSubPackageMap.clear();
@@ -27640,16 +27671,16 @@ function createScanService(ctx) {
27640
27671
  subPackage,
27641
27672
  entries: resolveSubPackageEntries(subPackage)
27642
27673
  };
27643
- const subPackageConfig = _optionalChain([ctx, 'access', _517 => _517.configService, 'access', _518 => _518.weappViteConfig, 'optionalAccess', _519 => _519.subPackages, 'optionalAccess', _520 => _520[subPackage.root]]);
27644
- meta.subPackage.dependencies = _optionalChain([subPackageConfig, 'optionalAccess', _521 => _521.dependencies]);
27645
- meta.subPackage.inlineConfig = _optionalChain([subPackageConfig, 'optionalAccess', _522 => _522.inlineConfig]);
27646
- meta.autoImportComponents = _optionalChain([subPackageConfig, 'optionalAccess', _523 => _523.autoImportComponents]);
27674
+ const subPackageConfig = _optionalChain([ctx, 'access', _522 => _522.configService, 'access', _523 => _523.weappViteConfig, 'optionalAccess', _524 => _524.subPackages, 'optionalAccess', _525 => _525[subPackage.root]]);
27675
+ meta.subPackage.dependencies = _optionalChain([subPackageConfig, 'optionalAccess', _526 => _526.dependencies]);
27676
+ meta.subPackage.inlineConfig = _optionalChain([subPackageConfig, 'optionalAccess', _527 => _527.inlineConfig]);
27677
+ meta.autoImportComponents = _optionalChain([subPackageConfig, 'optionalAccess', _528 => _528.autoImportComponents]);
27647
27678
  meta.styleEntries = normalizeSubPackageStyleEntries(
27648
- _optionalChain([subPackageConfig, 'optionalAccess', _524 => _524.styles]),
27679
+ _optionalChain([subPackageConfig, 'optionalAccess', _529 => _529.styles]),
27649
27680
  subPackage,
27650
27681
  ctx.configService
27651
27682
  );
27652
- meta.watchSharedStyles = _nullishCoalesce(_optionalChain([subPackageConfig, 'optionalAccess', _525 => _525.watchSharedStyles]), () => ( true));
27683
+ meta.watchSharedStyles = _nullishCoalesce(_optionalChain([subPackageConfig, 'optionalAccess', _530 => _530.watchSharedStyles]), () => ( true));
27653
27684
  metas.push(meta);
27654
27685
  if (subPackage.root) {
27655
27686
  subPackageMap.set(subPackage.root, meta);
@@ -27705,11 +27736,11 @@ function createScanService(ctx) {
27705
27736
  loadSubPackages,
27706
27737
  isMainPackageFileName,
27707
27738
  get workersOptions() {
27708
- return _optionalChain([scanState, 'access', _526 => _526.appEntry, 'optionalAccess', _527 => _527.json, 'optionalAccess', _528 => _528.workers]);
27739
+ return _optionalChain([scanState, 'access', _531 => _531.appEntry, 'optionalAccess', _532 => _532.json, 'optionalAccess', _533 => _533.workers]);
27709
27740
  },
27710
27741
  get workersDir() {
27711
- const workersOptions = _optionalChain([scanState, 'access', _529 => _529.appEntry, 'optionalAccess', _530 => _530.json, 'optionalAccess', _531 => _531.workers]);
27712
- return typeof workersOptions === "object" ? _optionalChain([workersOptions, 'optionalAccess', _532 => _532.path]) : workersOptions;
27742
+ const workersOptions = _optionalChain([scanState, 'access', _534 => _534.appEntry, 'optionalAccess', _535 => _535.json, 'optionalAccess', _536 => _536.workers]);
27743
+ return typeof workersOptions === "object" ? _optionalChain([workersOptions, 'optionalAccess', _537 => _537.path]) : workersOptions;
27713
27744
  },
27714
27745
  markDirty() {
27715
27746
  scanState.isDirty = true;
@@ -27756,7 +27787,7 @@ function createWatcherService(ctx) {
27756
27787
  },
27757
27788
  setRollupWatcher(watcher, root = "/") {
27758
27789
  const oldWatcher = rollupWatcherMap.get(root);
27759
- _optionalChain([oldWatcher, 'optionalAccess', _533 => _533.close, 'call', _534 => _534()]);
27790
+ _optionalChain([oldWatcher, 'optionalAccess', _538 => _538.close, 'call', _539 => _539()]);
27760
27791
  rollupWatcherMap.set(root, watcher);
27761
27792
  },
27762
27793
  closeAll() {
@@ -27769,7 +27800,7 @@ function createWatcherService(ctx) {
27769
27800
  });
27770
27801
  });
27771
27802
  sidecarWatcherMap.clear();
27772
- void _optionalChain([ctx, 'access', _535 => _535.webService, 'optionalAccess', _536 => _536.close, 'call', _537 => _537(), 'access', _538 => _538.catch, 'call', _539 => _539(() => {
27803
+ void _optionalChain([ctx, 'access', _540 => _540.webService, 'optionalAccess', _541 => _541.close, 'call', _542 => _542(), 'access', _543 => _543.catch, 'call', _544 => _544(() => {
27773
27804
  })]);
27774
27805
  },
27775
27806
  close(root = "/") {
@@ -27785,7 +27816,7 @@ function createWatcherService(ctx) {
27785
27816
  sidecarWatcherMap.delete(root);
27786
27817
  }
27787
27818
  if (rollupWatcherMap.size === 0 && sidecarWatcherMap.size === 0) {
27788
- void _optionalChain([ctx, 'access', _540 => _540.webService, 'optionalAccess', _541 => _541.close, 'call', _542 => _542(), 'access', _543 => _543.catch, 'call', _544 => _544(() => {
27819
+ void _optionalChain([ctx, 'access', _545 => _545.webService, 'optionalAccess', _546 => _546.close, 'call', _547 => _547(), 'access', _548 => _548.catch, 'call', _549 => _549(() => {
27789
27820
  })]);
27790
27821
  }
27791
27822
  }
@@ -27798,7 +27829,7 @@ function createWatcherServicePlugin(ctx) {
27798
27829
  name: "weapp-runtime:watcher-service",
27799
27830
  closeBundle() {
27800
27831
  const configService = ctx.configService;
27801
- const isWatchMode = _optionalChain([configService, 'optionalAccess', _545 => _545.isDev]) || Boolean(_optionalChain([configService, 'optionalAccess', _546 => _546.inlineConfig, 'optionalAccess', _547 => _547.build, 'optionalAccess', _548 => _548.watch]));
27832
+ const isWatchMode = _optionalChain([configService, 'optionalAccess', _550 => _550.isDev]) || Boolean(_optionalChain([configService, 'optionalAccess', _551 => _551.inlineConfig, 'optionalAccess', _552 => _552.build, 'optionalAccess', _553 => _553.watch]));
27802
27833
  if (!isWatchMode) {
27803
27834
  service.closeAll();
27804
27835
  }
@@ -27815,10 +27846,10 @@ function createWebService(ctx) {
27815
27846
  }
27816
27847
  let devServer;
27817
27848
  function isEnabled() {
27818
- return Boolean(_optionalChain([ctx, 'access', _549 => _549.configService, 'optionalAccess', _550 => _550.weappWebConfig, 'optionalAccess', _551 => _551.enabled]));
27849
+ return Boolean(_optionalChain([ctx, 'access', _554 => _554.configService, 'optionalAccess', _555 => _555.weappWebConfig, 'optionalAccess', _556 => _556.enabled]));
27819
27850
  }
27820
27851
  async function startDevServer() {
27821
- if (!_optionalChain([ctx, 'access', _552 => _552.configService, 'optionalAccess', _553 => _553.isDev])) {
27852
+ if (!_optionalChain([ctx, 'access', _557 => _557.configService, 'optionalAccess', _558 => _558.isDev])) {
27822
27853
  return void 0;
27823
27854
  }
27824
27855
  if (!isEnabled()) {
@@ -27827,7 +27858,7 @@ function createWebService(ctx) {
27827
27858
  if (devServer) {
27828
27859
  return devServer;
27829
27860
  }
27830
- const inlineConfig = _optionalChain([ctx, 'access', _554 => _554.configService, 'optionalAccess', _555 => _555.mergeWeb, 'call', _556 => _556()]);
27861
+ const inlineConfig = _optionalChain([ctx, 'access', _559 => _559.configService, 'optionalAccess', _560 => _560.mergeWeb, 'call', _561 => _561()]);
27831
27862
  if (!inlineConfig) {
27832
27863
  return void 0;
27833
27864
  }
@@ -27840,7 +27871,7 @@ function createWebService(ctx) {
27840
27871
  if (!isEnabled()) {
27841
27872
  return void 0;
27842
27873
  }
27843
- const inlineConfig = _optionalChain([ctx, 'access', _557 => _557.configService, 'optionalAccess', _558 => _558.mergeWeb, 'call', _559 => _559()]);
27874
+ const inlineConfig = _optionalChain([ctx, 'access', _562 => _562.configService, 'optionalAccess', _563 => _563.mergeWeb, 'call', _564 => _564()]);
27844
27875
  if (!inlineConfig) {
27845
27876
  return void 0;
27846
27877
  }
@@ -27870,7 +27901,7 @@ function createWebServicePlugin(ctx) {
27870
27901
  return {
27871
27902
  name: "weapp-runtime:web-service",
27872
27903
  async closeBundle() {
27873
- if (!_optionalChain([ctx, 'access', _560 => _560.configService, 'optionalAccess', _561 => _561.isDev])) {
27904
+ if (!_optionalChain([ctx, 'access', _565 => _565.configService, 'optionalAccess', _566 => _566.isDev])) {
27874
27905
  await service.close();
27875
27906
  }
27876
27907
  }
@@ -30521,7 +30552,7 @@ function createWxmlService(ctx) {
30521
30552
  return set3;
30522
30553
  }
30523
30554
  function clearAll() {
30524
- const currentRoot = _optionalChain([ctx, 'access', _562 => _562.configService, 'optionalAccess', _563 => _563.currentSubPackageRoot]);
30555
+ const currentRoot = _optionalChain([ctx, 'access', _567 => _567.configService, 'optionalAccess', _568 => _568.currentSubPackageRoot]);
30525
30556
  if (!currentRoot) {
30526
30557
  depsMap.clear();
30527
30558
  tokenMap.clear();
@@ -30580,7 +30611,7 @@ function createWxmlService(ctx) {
30580
30611
  if (!ctx.configService) {
30581
30612
  throw new Error("configService must be initialized before scanning wxml");
30582
30613
  }
30583
- const wxmlConfig = _nullishCoalesce(_optionalChain([ctx, 'access', _564 => _564.configService, 'access', _565 => _565.weappViteConfig, 'optionalAccess', _566 => _566.wxml]), () => ( _optionalChain([ctx, 'access', _567 => _567.configService, 'access', _568 => _568.weappViteConfig, 'optionalAccess', _569 => _569.enhance, 'optionalAccess', _570 => _570.wxml])));
30614
+ const wxmlConfig = _nullishCoalesce(_optionalChain([ctx, 'access', _569 => _569.configService, 'access', _570 => _570.weappViteConfig, 'optionalAccess', _571 => _571.wxml]), () => ( _optionalChain([ctx, 'access', _572 => _572.configService, 'access', _573 => _573.weappViteConfig, 'optionalAccess', _574 => _574.enhance, 'optionalAccess', _575 => _575.wxml])));
30584
30615
  return scanWxml(wxml, {
30585
30616
  platform: ctx.configService.platform,
30586
30617
  ...wxmlConfig === true ? {} : wxmlConfig