weapp-vite 5.9.4 → 5.10.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.
Files changed (45) hide show
  1. package/dist/auto-import-components/resolvers.cjs +69 -6
  2. package/dist/auto-import-components/resolvers.d.cts +3 -1
  3. package/dist/auto-import-components/resolvers.d.ts +3 -1
  4. package/dist/auto-import-components/resolvers.mjs +65 -2
  5. package/dist/auto-routes.cjs +8 -8
  6. package/dist/auto-routes.mjs +4 -4
  7. package/dist/chunk-ALIVH5AT.cjs +6 -0
  8. package/dist/{chunk-GSJZUMRD.cjs → chunk-CATHGUH7.cjs} +1038 -860
  9. package/dist/{chunk-3V77QISZ.mjs → chunk-F7RWFAP5.mjs} +2 -2
  10. package/dist/{chunk-R4NBLERP.mjs → chunk-G2UQTCAL.mjs} +2 -2
  11. package/dist/{chunk-FUIUGCNV.cjs → chunk-GVCMPTOW.cjs} +2 -2
  12. package/dist/{chunk-VTF7DPLC.mjs → chunk-LARVATLS.mjs} +779 -601
  13. package/dist/{chunk-FYXAC53C.mjs → chunk-LREXY56M.mjs} +1 -1
  14. package/dist/{chunk-3OFG76US.cjs → chunk-LSMP2NHG.cjs} +2 -2
  15. package/dist/{chunk-VNPRE7DQ.mjs → chunk-M4CXUCUL.mjs} +1 -1
  16. package/dist/{chunk-KV5JVZNT.cjs → chunk-NA65OEWW.cjs} +2 -2
  17. package/dist/{chunk-W5OEPQ7S.cjs → chunk-XU72DDOS.cjs} +6 -6
  18. package/dist/{chunk-B4H5W45I.mjs → chunk-YTQU6H6S.mjs} +1 -1
  19. package/dist/cli.cjs +77 -77
  20. package/dist/cli.mjs +3 -3
  21. package/dist/{config-CRwMOjkF.d.ts → config-9JglUSN2.d.ts} +4 -0
  22. package/dist/{config-C8y2cWbg.d.cts → config-D1eBLaq2.d.cts} +4 -0
  23. package/dist/config.cjs +4 -4
  24. package/dist/config.d.cts +1 -1
  25. package/dist/config.d.ts +1 -1
  26. package/dist/config.mjs +3 -3
  27. package/dist/index.cjs +8 -8
  28. package/dist/index.d.cts +2 -2
  29. package/dist/index.d.ts +2 -2
  30. package/dist/index.mjs +6 -6
  31. package/dist/json.cjs +3 -3
  32. package/dist/json.d.cts +1 -1
  33. package/dist/json.d.ts +1 -1
  34. package/dist/json.mjs +2 -2
  35. package/dist/types.cjs +9 -9
  36. package/dist/types.d.cts +1 -1
  37. package/dist/types.d.ts +1 -1
  38. package/dist/types.mjs +2 -2
  39. package/dist/volar.cjs +2 -2
  40. package/dist/volar.mjs +1 -1
  41. package/modules/analyze-dashboard/assets/echarts.js +2 -2
  42. package/modules/analyze-dashboard/assets/rolldown-runtime.js +1 -1
  43. package/modules/analyze-dashboard/assets/vue.js +1 -1
  44. package/package.json +15 -15
  45. package/dist/chunk-MDUAIMDF.cjs +0 -6
@@ -3,7 +3,7 @@ import {
3
3
  __require,
4
4
  __toESM,
5
5
  init_esm_shims
6
- } from "./chunk-3V77QISZ.mjs";
6
+ } from "./chunk-F7RWFAP5.mjs";
7
7
 
8
8
  // ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/debug.js
9
9
  var require_debug = __commonJS({
@@ -2650,13 +2650,13 @@ function extractComponentProps(code) {
2650
2650
  });
2651
2651
  let props = /* @__PURE__ */ new Map();
2652
2652
  traverse(ast, {
2653
- CallExpression(path36) {
2653
+ CallExpression(path37) {
2654
2654
  if (props.size > 0) {
2655
2655
  return;
2656
2656
  }
2657
- const callee = path36.node.callee;
2657
+ const callee = path37.node.callee;
2658
2658
  if (callee.type === "Identifier" && callee.name === "Component") {
2659
- const [options] = path36.node.arguments;
2659
+ const [options] = path37.node.arguments;
2660
2660
  if (options && options.type === "ObjectExpression") {
2661
2661
  props = extractComponentProperties(options);
2662
2662
  }
@@ -4381,7 +4381,7 @@ var ReaddirpStream = class extends Readable {
4381
4381
  this._directoryFilter = normalizeFilter(opts.directoryFilter);
4382
4382
  const statMethod = opts.lstat ? lstat : stat;
4383
4383
  if (wantBigintFsStats) {
4384
- this._stat = (path36) => statMethod(path36, { bigint: true });
4384
+ this._stat = (path37) => statMethod(path37, { bigint: true });
4385
4385
  } else {
4386
4386
  this._stat = statMethod;
4387
4387
  }
@@ -4406,8 +4406,8 @@ var ReaddirpStream = class extends Readable {
4406
4406
  const par = this.parent;
4407
4407
  const fil = par && par.files;
4408
4408
  if (fil && fil.length > 0) {
4409
- const { path: path36, depth } = par;
4410
- const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path36));
4409
+ const { path: path37, depth } = par;
4410
+ const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path37));
4411
4411
  const awaited = await Promise.all(slice);
4412
4412
  for (const entry of awaited) {
4413
4413
  if (!entry)
@@ -4447,20 +4447,20 @@ var ReaddirpStream = class extends Readable {
4447
4447
  this.reading = false;
4448
4448
  }
4449
4449
  }
4450
- async _exploreDir(path36, depth) {
4450
+ async _exploreDir(path37, depth) {
4451
4451
  let files;
4452
4452
  try {
4453
- files = await readdir(path36, this._rdOptions);
4453
+ files = await readdir(path37, this._rdOptions);
4454
4454
  } catch (error) {
4455
4455
  this._onError(error);
4456
4456
  }
4457
- return { files, depth, path: path36 };
4457
+ return { files, depth, path: path37 };
4458
4458
  }
4459
- async _formatEntry(dirent, path36) {
4459
+ async _formatEntry(dirent, path37) {
4460
4460
  let entry;
4461
4461
  const basename4 = this._isDirent ? dirent.name : dirent;
4462
4462
  try {
4463
- const fullPath = presolve(pjoin(path36, basename4));
4463
+ const fullPath = presolve(pjoin(path37, basename4));
4464
4464
  entry = { path: prelative(this._root, fullPath), fullPath, basename: basename4 };
4465
4465
  entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
4466
4466
  } catch (err) {
@@ -4861,16 +4861,16 @@ var delFromSet = (main, prop, item) => {
4861
4861
  };
4862
4862
  var isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val;
4863
4863
  var FsWatchInstances = /* @__PURE__ */ new Map();
4864
- function createFsWatchInstance(path36, options, listener, errHandler, emitRaw) {
4864
+ function createFsWatchInstance(path37, options, listener, errHandler, emitRaw) {
4865
4865
  const handleEvent = (rawEvent, evPath) => {
4866
- listener(path36);
4867
- emitRaw(rawEvent, evPath, { watchedPath: path36 });
4868
- if (evPath && path36 !== evPath) {
4869
- fsWatchBroadcast(sysPath.resolve(path36, evPath), KEY_LISTENERS, sysPath.join(path36, evPath));
4866
+ listener(path37);
4867
+ emitRaw(rawEvent, evPath, { watchedPath: path37 });
4868
+ if (evPath && path37 !== evPath) {
4869
+ fsWatchBroadcast(sysPath.resolve(path37, evPath), KEY_LISTENERS, sysPath.join(path37, evPath));
4870
4870
  }
4871
4871
  };
4872
4872
  try {
4873
- return fs_watch(path36, {
4873
+ return fs_watch(path37, {
4874
4874
  persistent: options.persistent
4875
4875
  }, handleEvent);
4876
4876
  } catch (error) {
@@ -4886,12 +4886,12 @@ var fsWatchBroadcast = (fullPath, listenerType, val1, val2, val3) => {
4886
4886
  listener(val1, val2, val3);
4887
4887
  });
4888
4888
  };
4889
- var setFsWatchListener = (path36, fullPath, options, handlers) => {
4889
+ var setFsWatchListener = (path37, fullPath, options, handlers) => {
4890
4890
  const { listener, errHandler, rawEmitter } = handlers;
4891
4891
  let cont = FsWatchInstances.get(fullPath);
4892
4892
  let watcher;
4893
4893
  if (!options.persistent) {
4894
- watcher = createFsWatchInstance(path36, options, listener, errHandler, rawEmitter);
4894
+ watcher = createFsWatchInstance(path37, options, listener, errHandler, rawEmitter);
4895
4895
  if (!watcher)
4896
4896
  return;
4897
4897
  return watcher.close.bind(watcher);
@@ -4902,7 +4902,7 @@ var setFsWatchListener = (path36, fullPath, options, handlers) => {
4902
4902
  addAndConvert(cont, KEY_RAW, rawEmitter);
4903
4903
  } else {
4904
4904
  watcher = createFsWatchInstance(
4905
- path36,
4905
+ path37,
4906
4906
  options,
4907
4907
  fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS),
4908
4908
  errHandler,
@@ -4917,7 +4917,7 @@ var setFsWatchListener = (path36, fullPath, options, handlers) => {
4917
4917
  cont.watcherUnusable = true;
4918
4918
  if (isWindows && error.code === "EPERM") {
4919
4919
  try {
4920
- const fd = await open(path36, "r");
4920
+ const fd = await open(path37, "r");
4921
4921
  await fd.close();
4922
4922
  broadcastErr(error);
4923
4923
  } catch (err) {
@@ -4948,7 +4948,7 @@ var setFsWatchListener = (path36, fullPath, options, handlers) => {
4948
4948
  };
4949
4949
  };
4950
4950
  var FsWatchFileInstances = /* @__PURE__ */ new Map();
4951
- var setFsWatchFileListener = (path36, fullPath, options, handlers) => {
4951
+ var setFsWatchFileListener = (path37, fullPath, options, handlers) => {
4952
4952
  const { listener, rawEmitter } = handlers;
4953
4953
  let cont = FsWatchFileInstances.get(fullPath);
4954
4954
  const copts = cont && cont.options;
@@ -4970,7 +4970,7 @@ var setFsWatchFileListener = (path36, fullPath, options, handlers) => {
4970
4970
  });
4971
4971
  const currmtime = curr.mtimeMs;
4972
4972
  if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
4973
- foreach(cont.listeners, (listener2) => listener2(path36, curr));
4973
+ foreach(cont.listeners, (listener2) => listener2(path37, curr));
4974
4974
  }
4975
4975
  })
4976
4976
  };
@@ -4998,13 +4998,13 @@ var NodeFsHandler = class {
4998
4998
  * @param listener on fs change
4999
4999
  * @returns closer for the watcher instance
5000
5000
  */
5001
- _watchWithNodeFs(path36, listener) {
5001
+ _watchWithNodeFs(path37, listener) {
5002
5002
  const opts = this.fsw.options;
5003
- const directory = sysPath.dirname(path36);
5004
- const basename4 = sysPath.basename(path36);
5003
+ const directory = sysPath.dirname(path37);
5004
+ const basename4 = sysPath.basename(path37);
5005
5005
  const parent = this.fsw._getWatchedDir(directory);
5006
5006
  parent.add(basename4);
5007
- const absolutePath = sysPath.resolve(path36);
5007
+ const absolutePath = sysPath.resolve(path37);
5008
5008
  const options = {
5009
5009
  persistent: opts.persistent
5010
5010
  };
@@ -5014,12 +5014,12 @@ var NodeFsHandler = class {
5014
5014
  if (opts.usePolling) {
5015
5015
  const enableBin = opts.interval !== opts.binaryInterval;
5016
5016
  options.interval = enableBin && isBinaryPath(basename4) ? opts.binaryInterval : opts.interval;
5017
- closer = setFsWatchFileListener(path36, absolutePath, options, {
5017
+ closer = setFsWatchFileListener(path37, absolutePath, options, {
5018
5018
  listener,
5019
5019
  rawEmitter: this.fsw._emitRaw
5020
5020
  });
5021
5021
  } else {
5022
- closer = setFsWatchListener(path36, absolutePath, options, {
5022
+ closer = setFsWatchListener(path37, absolutePath, options, {
5023
5023
  listener,
5024
5024
  errHandler: this._boundHandleError,
5025
5025
  rawEmitter: this.fsw._emitRaw
@@ -5041,7 +5041,7 @@ var NodeFsHandler = class {
5041
5041
  let prevStats = stats;
5042
5042
  if (parent.has(basename4))
5043
5043
  return;
5044
- const listener = async (path36, newStats) => {
5044
+ const listener = async (path37, newStats) => {
5045
5045
  if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5))
5046
5046
  return;
5047
5047
  if (!newStats || newStats.mtimeMs === 0) {
@@ -5055,11 +5055,11 @@ var NodeFsHandler = class {
5055
5055
  this.fsw._emit(EV.CHANGE, file, newStats2);
5056
5056
  }
5057
5057
  if ((isMacos || isLinux || isFreeBSD) && prevStats.ino !== newStats2.ino) {
5058
- this.fsw._closeFile(path36);
5058
+ this.fsw._closeFile(path37);
5059
5059
  prevStats = newStats2;
5060
5060
  const closer2 = this._watchWithNodeFs(file, listener);
5061
5061
  if (closer2)
5062
- this.fsw._addPathCloser(path36, closer2);
5062
+ this.fsw._addPathCloser(path37, closer2);
5063
5063
  } else {
5064
5064
  prevStats = newStats2;
5065
5065
  }
@@ -5091,7 +5091,7 @@ var NodeFsHandler = class {
5091
5091
  * @param item basename of this item
5092
5092
  * @returns true if no more processing is needed for this entry.
5093
5093
  */
5094
- async _handleSymlink(entry, directory, path36, item) {
5094
+ async _handleSymlink(entry, directory, path37, item) {
5095
5095
  if (this.fsw.closed) {
5096
5096
  return;
5097
5097
  }
@@ -5101,7 +5101,7 @@ var NodeFsHandler = class {
5101
5101
  this.fsw._incrReadyCount();
5102
5102
  let linkPath;
5103
5103
  try {
5104
- linkPath = await fsrealpath(path36);
5104
+ linkPath = await fsrealpath(path37);
5105
5105
  } catch (e) {
5106
5106
  this.fsw._emitReady();
5107
5107
  return true;
@@ -5111,12 +5111,12 @@ var NodeFsHandler = class {
5111
5111
  if (dir.has(item)) {
5112
5112
  if (this.fsw._symlinkPaths.get(full) !== linkPath) {
5113
5113
  this.fsw._symlinkPaths.set(full, linkPath);
5114
- this.fsw._emit(EV.CHANGE, path36, entry.stats);
5114
+ this.fsw._emit(EV.CHANGE, path37, entry.stats);
5115
5115
  }
5116
5116
  } else {
5117
5117
  dir.add(item);
5118
5118
  this.fsw._symlinkPaths.set(full, linkPath);
5119
- this.fsw._emit(EV.ADD, path36, entry.stats);
5119
+ this.fsw._emit(EV.ADD, path37, entry.stats);
5120
5120
  }
5121
5121
  this.fsw._emitReady();
5122
5122
  return true;
@@ -5145,9 +5145,9 @@ var NodeFsHandler = class {
5145
5145
  return;
5146
5146
  }
5147
5147
  const item = entry.path;
5148
- let path36 = sysPath.join(directory, item);
5148
+ let path37 = sysPath.join(directory, item);
5149
5149
  current2.add(item);
5150
- if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path36, item)) {
5150
+ if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path37, item)) {
5151
5151
  return;
5152
5152
  }
5153
5153
  if (this.fsw.closed) {
@@ -5156,8 +5156,8 @@ var NodeFsHandler = class {
5156
5156
  }
5157
5157
  if (item === target || !target && !previous.has(item)) {
5158
5158
  this.fsw._incrReadyCount();
5159
- path36 = sysPath.join(dir, sysPath.relative(dir, path36));
5160
- this._addToNodeFs(path36, initialAdd, wh, depth + 1);
5159
+ path37 = sysPath.join(dir, sysPath.relative(dir, path37));
5160
+ this._addToNodeFs(path37, initialAdd, wh, depth + 1);
5161
5161
  }
5162
5162
  }).on(EV.ERROR, this._boundHandleError);
5163
5163
  return new Promise((resolve8, reject) => {
@@ -5226,13 +5226,13 @@ var NodeFsHandler = class {
5226
5226
  * @param depth Child path actually targeted for watch
5227
5227
  * @param target Child path actually targeted for watch
5228
5228
  */
5229
- async _addToNodeFs(path36, initialAdd, priorWh, depth, target) {
5229
+ async _addToNodeFs(path37, initialAdd, priorWh, depth, target) {
5230
5230
  const ready = this.fsw._emitReady;
5231
- if (this.fsw._isIgnored(path36) || this.fsw.closed) {
5231
+ if (this.fsw._isIgnored(path37) || this.fsw.closed) {
5232
5232
  ready();
5233
5233
  return false;
5234
5234
  }
5235
- const wh = this.fsw._getWatchHelpers(path36);
5235
+ const wh = this.fsw._getWatchHelpers(path37);
5236
5236
  if (priorWh) {
5237
5237
  wh.filterPath = (entry) => priorWh.filterPath(entry);
5238
5238
  wh.filterDir = (entry) => priorWh.filterDir(entry);
@@ -5248,8 +5248,8 @@ var NodeFsHandler = class {
5248
5248
  const follow = this.fsw.options.followSymlinks;
5249
5249
  let closer;
5250
5250
  if (stats.isDirectory()) {
5251
- const absPath = sysPath.resolve(path36);
5252
- const targetPath = follow ? await fsrealpath(path36) : path36;
5251
+ const absPath = sysPath.resolve(path37);
5252
+ const targetPath = follow ? await fsrealpath(path37) : path37;
5253
5253
  if (this.fsw.closed)
5254
5254
  return;
5255
5255
  closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
@@ -5259,29 +5259,29 @@ var NodeFsHandler = class {
5259
5259
  this.fsw._symlinkPaths.set(absPath, targetPath);
5260
5260
  }
5261
5261
  } else if (stats.isSymbolicLink()) {
5262
- const targetPath = follow ? await fsrealpath(path36) : path36;
5262
+ const targetPath = follow ? await fsrealpath(path37) : path37;
5263
5263
  if (this.fsw.closed)
5264
5264
  return;
5265
5265
  const parent = sysPath.dirname(wh.watchPath);
5266
5266
  this.fsw._getWatchedDir(parent).add(wh.watchPath);
5267
5267
  this.fsw._emit(EV.ADD, wh.watchPath, stats);
5268
- closer = await this._handleDir(parent, stats, initialAdd, depth, path36, wh, targetPath);
5268
+ closer = await this._handleDir(parent, stats, initialAdd, depth, path37, wh, targetPath);
5269
5269
  if (this.fsw.closed)
5270
5270
  return;
5271
5271
  if (targetPath !== void 0) {
5272
- this.fsw._symlinkPaths.set(sysPath.resolve(path36), targetPath);
5272
+ this.fsw._symlinkPaths.set(sysPath.resolve(path37), targetPath);
5273
5273
  }
5274
5274
  } else {
5275
5275
  closer = this._handleFile(wh.watchPath, stats, initialAdd);
5276
5276
  }
5277
5277
  ready();
5278
5278
  if (closer)
5279
- this.fsw._addPathCloser(path36, closer);
5279
+ this.fsw._addPathCloser(path37, closer);
5280
5280
  return false;
5281
5281
  } catch (error) {
5282
5282
  if (this.fsw._handleError(error)) {
5283
5283
  ready();
5284
- return path36;
5284
+ return path37;
5285
5285
  }
5286
5286
  }
5287
5287
  }
@@ -5324,26 +5324,26 @@ function createPattern(matcher) {
5324
5324
  }
5325
5325
  return () => false;
5326
5326
  }
5327
- function normalizePath(path36) {
5328
- if (typeof path36 !== "string")
5327
+ function normalizePath(path37) {
5328
+ if (typeof path37 !== "string")
5329
5329
  throw new Error("string expected");
5330
- path36 = sysPath2.normalize(path36);
5331
- path36 = path36.replace(/\\/g, "/");
5330
+ path37 = sysPath2.normalize(path37);
5331
+ path37 = path37.replace(/\\/g, "/");
5332
5332
  let prepend = false;
5333
- if (path36.startsWith("//"))
5333
+ if (path37.startsWith("//"))
5334
5334
  prepend = true;
5335
5335
  const DOUBLE_SLASH_RE2 = /\/\//;
5336
- while (path36.match(DOUBLE_SLASH_RE2))
5337
- path36 = path36.replace(DOUBLE_SLASH_RE2, "/");
5336
+ while (path37.match(DOUBLE_SLASH_RE2))
5337
+ path37 = path37.replace(DOUBLE_SLASH_RE2, "/");
5338
5338
  if (prepend)
5339
- path36 = "/" + path36;
5340
- return path36;
5339
+ path37 = "/" + path37;
5340
+ return path37;
5341
5341
  }
5342
5342
  function matchPatterns(patterns, testString, stats) {
5343
- const path36 = normalizePath(testString);
5343
+ const path37 = normalizePath(testString);
5344
5344
  for (let index = 0; index < patterns.length; index++) {
5345
5345
  const pattern = patterns[index];
5346
- if (pattern(path36, stats)) {
5346
+ if (pattern(path37, stats)) {
5347
5347
  return true;
5348
5348
  }
5349
5349
  }
@@ -5383,19 +5383,19 @@ var toUnix = (string) => {
5383
5383
  }
5384
5384
  return str;
5385
5385
  };
5386
- var normalizePathToUnix = (path36) => toUnix(sysPath2.normalize(toUnix(path36)));
5387
- var normalizeIgnored = (cwd = "") => (path36) => {
5388
- if (typeof path36 === "string") {
5389
- return normalizePathToUnix(sysPath2.isAbsolute(path36) ? path36 : sysPath2.join(cwd, path36));
5386
+ var normalizePathToUnix = (path37) => toUnix(sysPath2.normalize(toUnix(path37)));
5387
+ var normalizeIgnored = (cwd = "") => (path37) => {
5388
+ if (typeof path37 === "string") {
5389
+ return normalizePathToUnix(sysPath2.isAbsolute(path37) ? path37 : sysPath2.join(cwd, path37));
5390
5390
  } else {
5391
- return path36;
5391
+ return path37;
5392
5392
  }
5393
5393
  };
5394
- var getAbsolutePath = (path36, cwd) => {
5395
- if (sysPath2.isAbsolute(path36)) {
5396
- return path36;
5394
+ var getAbsolutePath = (path37, cwd) => {
5395
+ if (sysPath2.isAbsolute(path37)) {
5396
+ return path37;
5397
5397
  }
5398
- return sysPath2.join(cwd, path36);
5398
+ return sysPath2.join(cwd, path37);
5399
5399
  };
5400
5400
  var EMPTY_SET = Object.freeze(/* @__PURE__ */ new Set());
5401
5401
  var DirEntry = class {
@@ -5450,10 +5450,10 @@ var DirEntry = class {
5450
5450
  var STAT_METHOD_F = "stat";
5451
5451
  var STAT_METHOD_L = "lstat";
5452
5452
  var WatchHelper = class {
5453
- constructor(path36, follow, fsw) {
5453
+ constructor(path37, follow, fsw) {
5454
5454
  this.fsw = fsw;
5455
- const watchPath = path36;
5456
- this.path = path36 = path36.replace(REPLACER_RE, "");
5455
+ const watchPath = path37;
5456
+ this.path = path37 = path37.replace(REPLACER_RE, "");
5457
5457
  this.watchPath = watchPath;
5458
5458
  this.fullWatchPath = sysPath2.resolve(watchPath);
5459
5459
  this.dirParts = [];
@@ -5575,20 +5575,20 @@ var FSWatcher = class extends EventEmitter {
5575
5575
  this._closePromise = void 0;
5576
5576
  let paths = unifyPaths(paths_);
5577
5577
  if (cwd) {
5578
- paths = paths.map((path36) => {
5579
- const absPath = getAbsolutePath(path36, cwd);
5578
+ paths = paths.map((path37) => {
5579
+ const absPath = getAbsolutePath(path37, cwd);
5580
5580
  return absPath;
5581
5581
  });
5582
5582
  }
5583
- paths.forEach((path36) => {
5584
- this._removeIgnoredPath(path36);
5583
+ paths.forEach((path37) => {
5584
+ this._removeIgnoredPath(path37);
5585
5585
  });
5586
5586
  this._userIgnored = void 0;
5587
5587
  if (!this._readyCount)
5588
5588
  this._readyCount = 0;
5589
5589
  this._readyCount += paths.length;
5590
- Promise.all(paths.map(async (path36) => {
5591
- const res = await this._nodeFsHandler._addToNodeFs(path36, !_internal, void 0, 0, _origAdd);
5590
+ Promise.all(paths.map(async (path37) => {
5591
+ const res = await this._nodeFsHandler._addToNodeFs(path37, !_internal, void 0, 0, _origAdd);
5592
5592
  if (res)
5593
5593
  this._emitReady();
5594
5594
  return res;
@@ -5610,17 +5610,17 @@ var FSWatcher = class extends EventEmitter {
5610
5610
  return this;
5611
5611
  const paths = unifyPaths(paths_);
5612
5612
  const { cwd } = this.options;
5613
- paths.forEach((path36) => {
5614
- if (!sysPath2.isAbsolute(path36) && !this._closers.has(path36)) {
5613
+ paths.forEach((path37) => {
5614
+ if (!sysPath2.isAbsolute(path37) && !this._closers.has(path37)) {
5615
5615
  if (cwd)
5616
- path36 = sysPath2.join(cwd, path36);
5617
- path36 = sysPath2.resolve(path36);
5616
+ path37 = sysPath2.join(cwd, path37);
5617
+ path37 = sysPath2.resolve(path37);
5618
5618
  }
5619
- this._closePath(path36);
5620
- this._addIgnoredPath(path36);
5621
- if (this._watched.has(path36)) {
5619
+ this._closePath(path37);
5620
+ this._addIgnoredPath(path37);
5621
+ if (this._watched.has(path37)) {
5622
5622
  this._addIgnoredPath({
5623
- path: path36,
5623
+ path: path37,
5624
5624
  recursive: true
5625
5625
  });
5626
5626
  }
@@ -5684,38 +5684,38 @@ var FSWatcher = class extends EventEmitter {
5684
5684
  * @param stats arguments to be passed with event
5685
5685
  * @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag
5686
5686
  */
5687
- async _emit(event, path36, stats) {
5687
+ async _emit(event, path37, stats) {
5688
5688
  if (this.closed)
5689
5689
  return;
5690
5690
  const opts = this.options;
5691
5691
  if (isWindows)
5692
- path36 = sysPath2.normalize(path36);
5692
+ path37 = sysPath2.normalize(path37);
5693
5693
  if (opts.cwd)
5694
- path36 = sysPath2.relative(opts.cwd, path36);
5695
- const args = [path36];
5694
+ path37 = sysPath2.relative(opts.cwd, path37);
5695
+ const args = [path37];
5696
5696
  if (stats != null)
5697
5697
  args.push(stats);
5698
5698
  const awf = opts.awaitWriteFinish;
5699
5699
  let pw;
5700
- if (awf && (pw = this._pendingWrites.get(path36))) {
5700
+ if (awf && (pw = this._pendingWrites.get(path37))) {
5701
5701
  pw.lastChange = /* @__PURE__ */ new Date();
5702
5702
  return this;
5703
5703
  }
5704
5704
  if (opts.atomic) {
5705
5705
  if (event === EVENTS.UNLINK) {
5706
- this._pendingUnlinks.set(path36, [event, ...args]);
5706
+ this._pendingUnlinks.set(path37, [event, ...args]);
5707
5707
  setTimeout(() => {
5708
- this._pendingUnlinks.forEach((entry, path37) => {
5708
+ this._pendingUnlinks.forEach((entry, path38) => {
5709
5709
  this.emit(...entry);
5710
5710
  this.emit(EVENTS.ALL, ...entry);
5711
- this._pendingUnlinks.delete(path37);
5711
+ this._pendingUnlinks.delete(path38);
5712
5712
  });
5713
5713
  }, typeof opts.atomic === "number" ? opts.atomic : 100);
5714
5714
  return this;
5715
5715
  }
5716
- if (event === EVENTS.ADD && this._pendingUnlinks.has(path36)) {
5716
+ if (event === EVENTS.ADD && this._pendingUnlinks.has(path37)) {
5717
5717
  event = EVENTS.CHANGE;
5718
- this._pendingUnlinks.delete(path36);
5718
+ this._pendingUnlinks.delete(path37);
5719
5719
  }
5720
5720
  }
5721
5721
  if (awf && (event === EVENTS.ADD || event === EVENTS.CHANGE) && this._readyEmitted) {
@@ -5733,16 +5733,16 @@ var FSWatcher = class extends EventEmitter {
5733
5733
  this.emitWithAll(event, args);
5734
5734
  }
5735
5735
  };
5736
- this._awaitWriteFinish(path36, awf.stabilityThreshold, event, awfEmit);
5736
+ this._awaitWriteFinish(path37, awf.stabilityThreshold, event, awfEmit);
5737
5737
  return this;
5738
5738
  }
5739
5739
  if (event === EVENTS.CHANGE) {
5740
- const isThrottled = !this._throttle(EVENTS.CHANGE, path36, 50);
5740
+ const isThrottled = !this._throttle(EVENTS.CHANGE, path37, 50);
5741
5741
  if (isThrottled)
5742
5742
  return this;
5743
5743
  }
5744
5744
  if (opts.alwaysStat && stats === void 0 && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
5745
- const fullPath = opts.cwd ? sysPath2.join(opts.cwd, path36) : path36;
5745
+ const fullPath = opts.cwd ? sysPath2.join(opts.cwd, path37) : path37;
5746
5746
  let stats2;
5747
5747
  try {
5748
5748
  stats2 = await stat3(fullPath);
@@ -5773,23 +5773,23 @@ var FSWatcher = class extends EventEmitter {
5773
5773
  * @param timeout duration of time to suppress duplicate actions
5774
5774
  * @returns tracking object or false if action should be suppressed
5775
5775
  */
5776
- _throttle(actionType, path36, timeout) {
5776
+ _throttle(actionType, path37, timeout) {
5777
5777
  if (!this._throttled.has(actionType)) {
5778
5778
  this._throttled.set(actionType, /* @__PURE__ */ new Map());
5779
5779
  }
5780
5780
  const action = this._throttled.get(actionType);
5781
5781
  if (!action)
5782
5782
  throw new Error("invalid throttle");
5783
- const actionPath = action.get(path36);
5783
+ const actionPath = action.get(path37);
5784
5784
  if (actionPath) {
5785
5785
  actionPath.count++;
5786
5786
  return false;
5787
5787
  }
5788
5788
  let timeoutObject;
5789
5789
  const clear = () => {
5790
- const item = action.get(path36);
5790
+ const item = action.get(path37);
5791
5791
  const count = item ? item.count : 0;
5792
- action.delete(path36);
5792
+ action.delete(path37);
5793
5793
  clearTimeout(timeoutObject);
5794
5794
  if (item)
5795
5795
  clearTimeout(item.timeoutObject);
@@ -5797,7 +5797,7 @@ var FSWatcher = class extends EventEmitter {
5797
5797
  };
5798
5798
  timeoutObject = setTimeout(clear, timeout);
5799
5799
  const thr = { timeoutObject, clear, count: 0 };
5800
- action.set(path36, thr);
5800
+ action.set(path37, thr);
5801
5801
  return thr;
5802
5802
  }
5803
5803
  _incrReadyCount() {
@@ -5811,44 +5811,44 @@ var FSWatcher = class extends EventEmitter {
5811
5811
  * @param event
5812
5812
  * @param awfEmit Callback to be called when ready for event to be emitted.
5813
5813
  */
5814
- _awaitWriteFinish(path36, threshold, event, awfEmit) {
5814
+ _awaitWriteFinish(path37, threshold, event, awfEmit) {
5815
5815
  const awf = this.options.awaitWriteFinish;
5816
5816
  if (typeof awf !== "object")
5817
5817
  return;
5818
5818
  const pollInterval = awf.pollInterval;
5819
5819
  let timeoutHandler;
5820
- let fullPath = path36;
5821
- if (this.options.cwd && !sysPath2.isAbsolute(path36)) {
5822
- fullPath = sysPath2.join(this.options.cwd, path36);
5820
+ let fullPath = path37;
5821
+ if (this.options.cwd && !sysPath2.isAbsolute(path37)) {
5822
+ fullPath = sysPath2.join(this.options.cwd, path37);
5823
5823
  }
5824
5824
  const now = /* @__PURE__ */ new Date();
5825
5825
  const writes = this._pendingWrites;
5826
5826
  function awaitWriteFinishFn(prevStat) {
5827
5827
  statcb(fullPath, (err, curStat) => {
5828
- if (err || !writes.has(path36)) {
5828
+ if (err || !writes.has(path37)) {
5829
5829
  if (err && err.code !== "ENOENT")
5830
5830
  awfEmit(err);
5831
5831
  return;
5832
5832
  }
5833
5833
  const now2 = Number(/* @__PURE__ */ new Date());
5834
5834
  if (prevStat && curStat.size !== prevStat.size) {
5835
- writes.get(path36).lastChange = now2;
5835
+ writes.get(path37).lastChange = now2;
5836
5836
  }
5837
- const pw = writes.get(path36);
5837
+ const pw = writes.get(path37);
5838
5838
  const df = now2 - pw.lastChange;
5839
5839
  if (df >= threshold) {
5840
- writes.delete(path36);
5840
+ writes.delete(path37);
5841
5841
  awfEmit(void 0, curStat);
5842
5842
  } else {
5843
5843
  timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval, curStat);
5844
5844
  }
5845
5845
  });
5846
5846
  }
5847
- if (!writes.has(path36)) {
5848
- writes.set(path36, {
5847
+ if (!writes.has(path37)) {
5848
+ writes.set(path37, {
5849
5849
  lastChange: now,
5850
5850
  cancelWait: () => {
5851
- writes.delete(path36);
5851
+ writes.delete(path37);
5852
5852
  clearTimeout(timeoutHandler);
5853
5853
  return event;
5854
5854
  }
@@ -5859,8 +5859,8 @@ var FSWatcher = class extends EventEmitter {
5859
5859
  /**
5860
5860
  * Determines whether user has asked to ignore this path.
5861
5861
  */
5862
- _isIgnored(path36, stats) {
5863
- if (this.options.atomic && DOT_RE.test(path36))
5862
+ _isIgnored(path37, stats) {
5863
+ if (this.options.atomic && DOT_RE.test(path37))
5864
5864
  return true;
5865
5865
  if (!this._userIgnored) {
5866
5866
  const { cwd } = this.options;
@@ -5870,17 +5870,17 @@ var FSWatcher = class extends EventEmitter {
5870
5870
  const list = [...ignoredPaths.map(normalizeIgnored(cwd)), ...ignored];
5871
5871
  this._userIgnored = anymatch(list, void 0);
5872
5872
  }
5873
- return this._userIgnored(path36, stats);
5873
+ return this._userIgnored(path37, stats);
5874
5874
  }
5875
- _isntIgnored(path36, stat5) {
5876
- return !this._isIgnored(path36, stat5);
5875
+ _isntIgnored(path37, stat5) {
5876
+ return !this._isIgnored(path37, stat5);
5877
5877
  }
5878
5878
  /**
5879
5879
  * Provides a set of common helpers and properties relating to symlink handling.
5880
5880
  * @param path file or directory pattern being watched
5881
5881
  */
5882
- _getWatchHelpers(path36) {
5883
- return new WatchHelper(path36, this.options.followSymlinks, this);
5882
+ _getWatchHelpers(path37) {
5883
+ return new WatchHelper(path37, this.options.followSymlinks, this);
5884
5884
  }
5885
5885
  // Directory helpers
5886
5886
  // -----------------
@@ -5912,63 +5912,63 @@ var FSWatcher = class extends EventEmitter {
5912
5912
  * @param item base path of item/directory
5913
5913
  */
5914
5914
  _remove(directory, item, isDirectory) {
5915
- const path36 = sysPath2.join(directory, item);
5916
- const fullPath = sysPath2.resolve(path36);
5917
- isDirectory = isDirectory != null ? isDirectory : this._watched.has(path36) || this._watched.has(fullPath);
5918
- if (!this._throttle("remove", path36, 100))
5915
+ const path37 = sysPath2.join(directory, item);
5916
+ const fullPath = sysPath2.resolve(path37);
5917
+ isDirectory = isDirectory != null ? isDirectory : this._watched.has(path37) || this._watched.has(fullPath);
5918
+ if (!this._throttle("remove", path37, 100))
5919
5919
  return;
5920
5920
  if (!isDirectory && this._watched.size === 1) {
5921
5921
  this.add(directory, item, true);
5922
5922
  }
5923
- const wp = this._getWatchedDir(path36);
5923
+ const wp = this._getWatchedDir(path37);
5924
5924
  const nestedDirectoryChildren = wp.getChildren();
5925
- nestedDirectoryChildren.forEach((nested) => this._remove(path36, nested));
5925
+ nestedDirectoryChildren.forEach((nested) => this._remove(path37, nested));
5926
5926
  const parent = this._getWatchedDir(directory);
5927
5927
  const wasTracked = parent.has(item);
5928
5928
  parent.remove(item);
5929
5929
  if (this._symlinkPaths.has(fullPath)) {
5930
5930
  this._symlinkPaths.delete(fullPath);
5931
5931
  }
5932
- let relPath = path36;
5932
+ let relPath = path37;
5933
5933
  if (this.options.cwd)
5934
- relPath = sysPath2.relative(this.options.cwd, path36);
5934
+ relPath = sysPath2.relative(this.options.cwd, path37);
5935
5935
  if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
5936
5936
  const event = this._pendingWrites.get(relPath).cancelWait();
5937
5937
  if (event === EVENTS.ADD)
5938
5938
  return;
5939
5939
  }
5940
- this._watched.delete(path36);
5940
+ this._watched.delete(path37);
5941
5941
  this._watched.delete(fullPath);
5942
5942
  const eventName = isDirectory ? EVENTS.UNLINK_DIR : EVENTS.UNLINK;
5943
- if (wasTracked && !this._isIgnored(path36))
5944
- this._emit(eventName, path36);
5945
- this._closePath(path36);
5943
+ if (wasTracked && !this._isIgnored(path37))
5944
+ this._emit(eventName, path37);
5945
+ this._closePath(path37);
5946
5946
  }
5947
5947
  /**
5948
5948
  * Closes all watchers for a path
5949
5949
  */
5950
- _closePath(path36) {
5951
- this._closeFile(path36);
5952
- const dir = sysPath2.dirname(path36);
5953
- this._getWatchedDir(dir).remove(sysPath2.basename(path36));
5950
+ _closePath(path37) {
5951
+ this._closeFile(path37);
5952
+ const dir = sysPath2.dirname(path37);
5953
+ this._getWatchedDir(dir).remove(sysPath2.basename(path37));
5954
5954
  }
5955
5955
  /**
5956
5956
  * Closes only file-specific watchers
5957
5957
  */
5958
- _closeFile(path36) {
5959
- const closers = this._closers.get(path36);
5958
+ _closeFile(path37) {
5959
+ const closers = this._closers.get(path37);
5960
5960
  if (!closers)
5961
5961
  return;
5962
5962
  closers.forEach((closer) => closer());
5963
- this._closers.delete(path36);
5963
+ this._closers.delete(path37);
5964
5964
  }
5965
- _addPathCloser(path36, closer) {
5965
+ _addPathCloser(path37, closer) {
5966
5966
  if (!closer)
5967
5967
  return;
5968
- let list = this._closers.get(path36);
5968
+ let list = this._closers.get(path37);
5969
5969
  if (!list) {
5970
5970
  list = [];
5971
- this._closers.set(path36, list);
5971
+ this._closers.set(path37, list);
5972
5972
  }
5973
5973
  list.push(closer);
5974
5974
  }
@@ -6000,10 +6000,10 @@ var esm_default = { watch, FSWatcher };
6000
6000
  // src/runtime/buildPlugin.ts
6001
6001
  import path11 from "pathe";
6002
6002
 
6003
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/index.js
6003
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/index.js
6004
6004
  init_esm_shims();
6005
6005
 
6006
- // ../../node_modules/.pnpm/glob@11.0.3/node_modules/glob/dist/esm/index.js
6006
+ // ../../node_modules/.pnpm/glob@13.0.0/node_modules/glob/dist/esm/index.js
6007
6007
  init_esm_shims();
6008
6008
 
6009
6009
  // ../../node_modules/.pnpm/minimatch@10.1.1/node_modules/minimatch/dist/esm/index.js
@@ -7572,11 +7572,11 @@ minimatch.Minimatch = Minimatch;
7572
7572
  minimatch.escape = escape;
7573
7573
  minimatch.unescape = unescape2;
7574
7574
 
7575
- // ../../node_modules/.pnpm/glob@11.0.3/node_modules/glob/dist/esm/glob.js
7575
+ // ../../node_modules/.pnpm/glob@13.0.0/node_modules/glob/dist/esm/glob.js
7576
7576
  init_esm_shims();
7577
7577
  import { fileURLToPath as fileURLToPath2 } from "url";
7578
7578
 
7579
- // ../../node_modules/.pnpm/path-scurry@2.0.0/node_modules/path-scurry/dist/esm/index.js
7579
+ // ../../node_modules/.pnpm/path-scurry@2.0.1/node_modules/path-scurry/dist/esm/index.js
7580
7580
  init_esm_shims();
7581
7581
  import { posix, win32 } from "path";
7582
7582
  import { fileURLToPath } from "url";
@@ -8463,7 +8463,7 @@ var Minipass = class extends EventEmitter2 {
8463
8463
  }
8464
8464
  };
8465
8465
 
8466
- // ../../node_modules/.pnpm/path-scurry@2.0.0/node_modules/path-scurry/dist/esm/index.js
8466
+ // ../../node_modules/.pnpm/path-scurry@2.0.1/node_modules/path-scurry/dist/esm/index.js
8467
8467
  var realpathSync = rps.native;
8468
8468
  var defaultFS = {
8469
8469
  lstatSync,
@@ -8508,7 +8508,7 @@ var ENOREALPATH = 512;
8508
8508
  var ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH;
8509
8509
  var TYPEMASK = 1023;
8510
8510
  var entToType = (s) => s.isFile() ? IFREG : s.isDirectory() ? IFDIR : s.isSymbolicLink() ? IFLNK : s.isCharacterDevice() ? IFCHR : s.isBlockDevice() ? IFBLK : s.isSocket() ? IFSOCK : s.isFIFO() ? IFIFO : UNKNOWN;
8511
- var normalizeCache = /* @__PURE__ */ new Map();
8511
+ var normalizeCache = new LRUCache({ max: 2 ** 12 });
8512
8512
  var normalize2 = (s) => {
8513
8513
  const c = normalizeCache.get(s);
8514
8514
  if (c)
@@ -8517,7 +8517,7 @@ var normalize2 = (s) => {
8517
8517
  normalizeCache.set(s, n2);
8518
8518
  return n2;
8519
8519
  };
8520
- var normalizeNocaseCache = /* @__PURE__ */ new Map();
8520
+ var normalizeNocaseCache = new LRUCache({ max: 2 ** 12 });
8521
8521
  var normalizeNocase = (s) => {
8522
8522
  const c = normalizeNocaseCache.get(s);
8523
8523
  if (c)
@@ -8674,6 +8674,7 @@ var PathBase = class {
8674
8674
  get parentPath() {
8675
8675
  return (this.parent || this).fullpath();
8676
8676
  }
8677
+ /* c8 ignore start */
8677
8678
  /**
8678
8679
  * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively,
8679
8680
  * this property refers to the *parent* path, not the path object itself.
@@ -8683,6 +8684,7 @@ var PathBase = class {
8683
8684
  get path() {
8684
8685
  return this.parentPath;
8685
8686
  }
8687
+ /* c8 ignore stop */
8686
8688
  /**
8687
8689
  * Do not create new Path objects directly. They should always be accessed
8688
8690
  * via the PathScurry class or other methods on the Path class.
@@ -8728,12 +8730,12 @@ var PathBase = class {
8728
8730
  /**
8729
8731
  * Get the Path object referenced by the string path, resolved from this Path
8730
8732
  */
8731
- resolve(path36) {
8732
- if (!path36) {
8733
+ resolve(path37) {
8734
+ if (!path37) {
8733
8735
  return this;
8734
8736
  }
8735
- const rootPath = this.getRootString(path36);
8736
- const dir = path36.substring(rootPath.length);
8737
+ const rootPath = this.getRootString(path37);
8738
+ const dir = path37.substring(rootPath.length);
8737
8739
  const dirParts = dir.split(this.splitSep);
8738
8740
  const result = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts);
8739
8741
  return result;
@@ -9485,8 +9487,8 @@ var PathWin32 = class _PathWin32 extends PathBase {
9485
9487
  /**
9486
9488
  * @internal
9487
9489
  */
9488
- getRootString(path36) {
9489
- return win32.parse(path36).root;
9490
+ getRootString(path37) {
9491
+ return win32.parse(path37).root;
9490
9492
  }
9491
9493
  /**
9492
9494
  * @internal
@@ -9532,8 +9534,8 @@ var PathPosix = class _PathPosix extends PathBase {
9532
9534
  /**
9533
9535
  * @internal
9534
9536
  */
9535
- getRootString(path36) {
9536
- return path36.startsWith("/") ? "/" : "";
9537
+ getRootString(path37) {
9538
+ return path37.startsWith("/") ? "/" : "";
9537
9539
  }
9538
9540
  /**
9539
9541
  * @internal
@@ -9622,11 +9624,11 @@ var PathScurryBase = class {
9622
9624
  /**
9623
9625
  * Get the depth of a provided path, string, or the cwd
9624
9626
  */
9625
- depth(path36 = this.cwd) {
9626
- if (typeof path36 === "string") {
9627
- path36 = this.cwd.resolve(path36);
9627
+ depth(path37 = this.cwd) {
9628
+ if (typeof path37 === "string") {
9629
+ path37 = this.cwd.resolve(path37);
9628
9630
  }
9629
- return path36.depth();
9631
+ return path37.depth();
9630
9632
  }
9631
9633
  /**
9632
9634
  * Return the cache of child entries. Exposed so subclasses can create
@@ -10113,9 +10115,9 @@ var PathScurryBase = class {
10113
10115
  process10();
10114
10116
  return results;
10115
10117
  }
10116
- chdir(path36 = this.cwd) {
10118
+ chdir(path37 = this.cwd) {
10117
10119
  const oldCwd = this.cwd;
10118
- this.cwd = typeof path36 === "string" ? this.cwd.resolve(path36) : path36;
10120
+ this.cwd = typeof path37 === "string" ? this.cwd.resolve(path37) : path37;
10119
10121
  this.cwd[setAsCwd](oldCwd);
10120
10122
  }
10121
10123
  };
@@ -10189,7 +10191,7 @@ var PathScurryDarwin = class extends PathScurryPosix {
10189
10191
  var Path = process.platform === "win32" ? PathWin32 : PathPosix;
10190
10192
  var PathScurry = process.platform === "win32" ? PathScurryWin32 : process.platform === "darwin" ? PathScurryDarwin : PathScurryPosix;
10191
10193
 
10192
- // ../../node_modules/.pnpm/glob@11.0.3/node_modules/glob/dist/esm/pattern.js
10194
+ // ../../node_modules/.pnpm/glob@13.0.0/node_modules/glob/dist/esm/pattern.js
10193
10195
  init_esm_shims();
10194
10196
  var isPatternList = (pl2) => pl2.length >= 1;
10195
10197
  var isGlobList = (gl) => gl.length >= 1;
@@ -10355,10 +10357,10 @@ var Pattern = class _Pattern {
10355
10357
  }
10356
10358
  };
10357
10359
 
10358
- // ../../node_modules/.pnpm/glob@11.0.3/node_modules/glob/dist/esm/walker.js
10360
+ // ../../node_modules/.pnpm/glob@13.0.0/node_modules/glob/dist/esm/walker.js
10359
10361
  init_esm_shims();
10360
10362
 
10361
- // ../../node_modules/.pnpm/glob@11.0.3/node_modules/glob/dist/esm/ignore.js
10363
+ // ../../node_modules/.pnpm/glob@13.0.0/node_modules/glob/dist/esm/ignore.js
10362
10364
  init_esm_shims();
10363
10365
  var defaultPlatform2 = typeof process === "object" && process && typeof process.platform === "string" ? process.platform : "linux";
10364
10366
  var Ignore = class {
@@ -10446,7 +10448,7 @@ var Ignore = class {
10446
10448
  }
10447
10449
  };
10448
10450
 
10449
- // ../../node_modules/.pnpm/glob@11.0.3/node_modules/glob/dist/esm/processor.js
10451
+ // ../../node_modules/.pnpm/glob@13.0.0/node_modules/glob/dist/esm/processor.js
10450
10452
  init_esm_shims();
10451
10453
  var HasWalkedCache = class _HasWalkedCache {
10452
10454
  store;
@@ -10477,8 +10479,8 @@ var MatchRecord = class {
10477
10479
  }
10478
10480
  // match, absolute, ifdir
10479
10481
  entries() {
10480
- return [...this.store.entries()].map(([path36, n2]) => [
10481
- path36,
10482
+ return [...this.store.entries()].map(([path37, n2]) => [
10483
+ path37,
10482
10484
  !!(n2 & 2),
10483
10485
  !!(n2 & 1)
10484
10486
  ]);
@@ -10668,7 +10670,7 @@ var Processor = class _Processor {
10668
10670
  }
10669
10671
  };
10670
10672
 
10671
- // ../../node_modules/.pnpm/glob@11.0.3/node_modules/glob/dist/esm/walker.js
10673
+ // ../../node_modules/.pnpm/glob@13.0.0/node_modules/glob/dist/esm/walker.js
10672
10674
  var makeIgnore = (ignore, opts) => typeof ignore === "string" ? new Ignore([ignore], opts) : Array.isArray(ignore) ? new Ignore(ignore, opts) : ignore;
10673
10675
  var GlobUtil = class {
10674
10676
  path;
@@ -10683,9 +10685,9 @@ var GlobUtil = class {
10683
10685
  signal;
10684
10686
  maxDepth;
10685
10687
  includeChildMatches;
10686
- constructor(patterns, path36, opts) {
10688
+ constructor(patterns, path37, opts) {
10687
10689
  this.patterns = patterns;
10688
- this.path = path36;
10690
+ this.path = path37;
10689
10691
  this.opts = opts;
10690
10692
  this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/";
10691
10693
  this.includeChildMatches = opts.includeChildMatches !== false;
@@ -10704,11 +10706,11 @@ var GlobUtil = class {
10704
10706
  });
10705
10707
  }
10706
10708
  }
10707
- #ignored(path36) {
10708
- return this.seen.has(path36) || !!this.#ignore?.ignored?.(path36);
10709
+ #ignored(path37) {
10710
+ return this.seen.has(path37) || !!this.#ignore?.ignored?.(path37);
10709
10711
  }
10710
- #childrenIgnored(path36) {
10711
- return !!this.#ignore?.childrenIgnored?.(path36);
10712
+ #childrenIgnored(path37) {
10713
+ return !!this.#ignore?.childrenIgnored?.(path37);
10712
10714
  }
10713
10715
  // backpressure mechanism
10714
10716
  pause() {
@@ -10923,8 +10925,8 @@ var GlobUtil = class {
10923
10925
  };
10924
10926
  var GlobWalker = class extends GlobUtil {
10925
10927
  matches = /* @__PURE__ */ new Set();
10926
- constructor(patterns, path36, opts) {
10927
- super(patterns, path36, opts);
10928
+ constructor(patterns, path37, opts) {
10929
+ super(patterns, path37, opts);
10928
10930
  }
10929
10931
  matchEmit(e) {
10930
10932
  this.matches.add(e);
@@ -10961,8 +10963,8 @@ var GlobWalker = class extends GlobUtil {
10961
10963
  };
10962
10964
  var GlobStream = class extends GlobUtil {
10963
10965
  results;
10964
- constructor(patterns, path36, opts) {
10965
- super(patterns, path36, opts);
10966
+ constructor(patterns, path37, opts) {
10967
+ super(patterns, path37, opts);
10966
10968
  this.results = new Minipass({
10967
10969
  signal: this.signal,
10968
10970
  objectMode: true
@@ -10995,7 +10997,7 @@ var GlobStream = class extends GlobUtil {
10995
10997
  }
10996
10998
  };
10997
10999
 
10998
- // ../../node_modules/.pnpm/glob@11.0.3/node_modules/glob/dist/esm/glob.js
11000
+ // ../../node_modules/.pnpm/glob@13.0.0/node_modules/glob/dist/esm/glob.js
10999
11001
  var defaultPlatform3 = typeof process === "object" && process && typeof process.platform === "string" ? process.platform : "linux";
11000
11002
  var Glob = class {
11001
11003
  absolute;
@@ -11195,7 +11197,7 @@ var Glob = class {
11195
11197
  }
11196
11198
  };
11197
11199
 
11198
- // ../../node_modules/.pnpm/glob@11.0.3/node_modules/glob/dist/esm/has-magic.js
11200
+ // ../../node_modules/.pnpm/glob@13.0.0/node_modules/glob/dist/esm/has-magic.js
11199
11201
  init_esm_shims();
11200
11202
  var hasMagic = (pattern, options = {}) => {
11201
11203
  if (!Array.isArray(pattern)) {
@@ -11208,7 +11210,7 @@ var hasMagic = (pattern, options = {}) => {
11208
11210
  return false;
11209
11211
  };
11210
11212
 
11211
- // ../../node_modules/.pnpm/glob@11.0.3/node_modules/glob/dist/esm/index.js
11213
+ // ../../node_modules/.pnpm/glob@13.0.0/node_modules/glob/dist/esm/index.js
11212
11214
  function globStreamSync(pattern, options = {}) {
11213
11215
  return new Glob(pattern, options).streamSync();
11214
11216
  }
@@ -11256,7 +11258,7 @@ var glob = Object.assign(glob_, {
11256
11258
  });
11257
11259
  glob.glob = glob;
11258
11260
 
11259
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/opt-arg.js
11261
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/opt-arg.js
11260
11262
  init_esm_shims();
11261
11263
  var typeOrUndef = (val, t2) => typeof val === "undefined" || typeof val === t2;
11262
11264
  var isRimrafOptions = (o) => !!o && typeof o === "object" && typeOrUndef(o.preserveRoot, "boolean") && typeOrUndef(o.tmp, "string") && typeOrUndef(o.maxRetries, "number") && typeOrUndef(o.retryDelay, "number") && typeOrUndef(o.backoff, "number") && typeOrUndef(o.maxBackoff, "number") && (typeOrUndef(o.glob, "boolean") || o.glob && typeof o.glob === "object") && typeOrUndef(o.filter, "function");
@@ -11289,67 +11291,67 @@ var optArgT = (opt) => {
11289
11291
  var optArg = (opt = {}) => optArgT(opt);
11290
11292
  var optArgSync = (opt = {}) => optArgT(opt);
11291
11293
 
11292
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/path-arg.js
11294
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/path-arg.js
11293
11295
  init_esm_shims();
11294
11296
  import { parse as parse2, resolve as resolve3 } from "path";
11295
11297
  import { inspect } from "util";
11296
- var pathArg = (path36, opt = {}) => {
11297
- const type = typeof path36;
11298
+ var pathArg = (path37, opt = {}) => {
11299
+ const type = typeof path37;
11298
11300
  if (type !== "string") {
11299
- const ctor = path36 && type === "object" && path36.constructor;
11300
- const received = ctor && ctor.name ? `an instance of ${ctor.name}` : type === "object" ? inspect(path36) : `type ${type} ${path36}`;
11301
+ const ctor = path37 && type === "object" && path37.constructor;
11302
+ const received = ctor && ctor.name ? `an instance of ${ctor.name}` : type === "object" ? inspect(path37) : `type ${type} ${path37}`;
11301
11303
  const msg = `The "path" argument must be of type string. Received ${received}`;
11302
11304
  throw Object.assign(new TypeError(msg), {
11303
- path: path36,
11305
+ path: path37,
11304
11306
  code: "ERR_INVALID_ARG_TYPE"
11305
11307
  });
11306
11308
  }
11307
- if (/\0/.test(path36)) {
11309
+ if (/\0/.test(path37)) {
11308
11310
  const msg = "path must be a string without null bytes";
11309
11311
  throw Object.assign(new TypeError(msg), {
11310
- path: path36,
11312
+ path: path37,
11311
11313
  code: "ERR_INVALID_ARG_VALUE"
11312
11314
  });
11313
11315
  }
11314
- path36 = resolve3(path36);
11315
- const { root } = parse2(path36);
11316
- if (path36 === root && opt.preserveRoot !== false) {
11316
+ path37 = resolve3(path37);
11317
+ const { root } = parse2(path37);
11318
+ if (path37 === root && opt.preserveRoot !== false) {
11317
11319
  const msg = "refusing to remove root directory without preserveRoot:false";
11318
11320
  throw Object.assign(new Error(msg), {
11319
- path: path36,
11321
+ path: path37,
11320
11322
  code: "ERR_PRESERVE_ROOT"
11321
11323
  });
11322
11324
  }
11323
11325
  if (process.platform === "win32") {
11324
11326
  const badWinChars = /[*|"<>?:]/;
11325
- const { root: root2 } = parse2(path36);
11326
- if (badWinChars.test(path36.substring(root2.length))) {
11327
+ const { root: root2 } = parse2(path37);
11328
+ if (badWinChars.test(path37.substring(root2.length))) {
11327
11329
  throw Object.assign(new Error("Illegal characters in path."), {
11328
- path: path36,
11330
+ path: path37,
11329
11331
  code: "EINVAL"
11330
11332
  });
11331
11333
  }
11332
11334
  }
11333
- return path36;
11335
+ return path37;
11334
11336
  };
11335
11337
  var path_arg_default = pathArg;
11336
11338
 
11337
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/rimraf-manual.js
11339
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/rimraf-manual.js
11338
11340
  init_esm_shims();
11339
11341
 
11340
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/rimraf-posix.js
11342
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/rimraf-posix.js
11341
11343
  init_esm_shims();
11342
11344
 
11343
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/fs.js
11345
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/fs.js
11344
11346
  init_esm_shims();
11345
11347
  import { readdirSync as rdSync } from "fs";
11346
11348
  import fsPromises from "fs/promises";
11347
11349
  import { chmodSync, mkdirSync, renameSync, rmdirSync, rmSync, statSync, lstatSync as lstatSync2, unlinkSync } from "fs";
11348
- var readdirSync2 = (path36) => rdSync(path36, { withFileTypes: true });
11350
+ var readdirSync2 = (path37) => rdSync(path37, { withFileTypes: true });
11349
11351
  var promises = {
11350
11352
  chmod: fsPromises.chmod,
11351
11353
  mkdir: fsPromises.mkdir,
11352
- readdir: (path36) => fsPromises.readdir(path36, { withFileTypes: true }),
11354
+ readdir: (path37) => fsPromises.readdir(path37, { withFileTypes: true }),
11353
11355
  rename: fsPromises.rename,
11354
11356
  rm: fsPromises.rm,
11355
11357
  rmdir: fsPromises.rmdir,
@@ -11358,32 +11360,32 @@ var promises = {
11358
11360
  unlink: fsPromises.unlink
11359
11361
  };
11360
11362
 
11361
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/rimraf-posix.js
11363
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/rimraf-posix.js
11362
11364
  import { parse as parse3, resolve as resolve4 } from "path";
11363
11365
 
11364
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/readdir-or-error.js
11366
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/readdir-or-error.js
11365
11367
  init_esm_shims();
11366
11368
  var { readdir: readdir4 } = promises;
11367
- var readdirOrError = (path36) => readdir4(path36).catch((er) => er);
11368
- var readdirOrErrorSync = (path36) => {
11369
+ var readdirOrError = (path37) => readdir4(path37).catch((er) => er);
11370
+ var readdirOrErrorSync = (path37) => {
11369
11371
  try {
11370
- return readdirSync2(path36);
11372
+ return readdirSync2(path37);
11371
11373
  } catch (er) {
11372
11374
  return er;
11373
11375
  }
11374
11376
  };
11375
11377
 
11376
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/ignore-enoent.js
11378
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/ignore-enoent.js
11377
11379
  init_esm_shims();
11378
11380
 
11379
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/error.js
11381
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/error.js
11380
11382
  init_esm_shims();
11381
11383
  var isRecord = (o) => !!o && typeof o === "object";
11382
11384
  var hasString = (o, key) => key in o && typeof o[key] === "string";
11383
11385
  var isFsError = (o) => isRecord(o) && hasString(o, "code") && hasString(o, "path");
11384
11386
  var errorCode = (er) => isRecord(er) && hasString(er, "code") ? er.code : null;
11385
11387
 
11386
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/ignore-enoent.js
11388
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/ignore-enoent.js
11387
11389
  var ignoreENOENT = async (p, rethrow) => p.catch((er) => {
11388
11390
  if (errorCode(er) === "ENOENT") {
11389
11391
  return;
@@ -11401,19 +11403,19 @@ var ignoreENOENTSync = (fn, rethrow) => {
11401
11403
  }
11402
11404
  };
11403
11405
 
11404
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/rimraf-posix.js
11406
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/rimraf-posix.js
11405
11407
  var { lstat: lstat4, rmdir, unlink } = promises;
11406
- var rimrafPosix = async (path36, opt) => {
11408
+ var rimrafPosix = async (path37, opt) => {
11407
11409
  opt?.signal?.throwIfAborted();
11408
- return await ignoreENOENT(lstat4(path36).then((stat5) => rimrafPosixDir(path36, opt, stat5))) ?? true;
11410
+ return await ignoreENOENT(lstat4(path37).then((stat5) => rimrafPosixDir(path37, opt, stat5))) ?? true;
11409
11411
  };
11410
- var rimrafPosixSync = (path36, opt) => {
11412
+ var rimrafPosixSync = (path37, opt) => {
11411
11413
  opt?.signal?.throwIfAborted();
11412
- return ignoreENOENTSync(() => rimrafPosixDirSync(path36, opt, lstatSync2(path36))) ?? true;
11414
+ return ignoreENOENTSync(() => rimrafPosixDirSync(path37, opt, lstatSync2(path37))) ?? true;
11413
11415
  };
11414
- var rimrafPosixDir = async (path36, opt, ent) => {
11416
+ var rimrafPosixDir = async (path37, opt, ent) => {
11415
11417
  opt?.signal?.throwIfAborted();
11416
- const entries = ent.isDirectory() ? await readdirOrError(path36) : null;
11418
+ const entries = ent.isDirectory() ? await readdirOrError(path37) : null;
11417
11419
  if (!Array.isArray(entries)) {
11418
11420
  if (entries) {
11419
11421
  if (errorCode(entries) === "ENOENT") {
@@ -11423,28 +11425,28 @@ var rimrafPosixDir = async (path36, opt, ent) => {
11423
11425
  throw entries;
11424
11426
  }
11425
11427
  }
11426
- if (opt.filter && !await opt.filter(path36, ent)) {
11428
+ if (opt.filter && !await opt.filter(path37, ent)) {
11427
11429
  return false;
11428
11430
  }
11429
- await ignoreENOENT(unlink(path36));
11431
+ await ignoreENOENT(unlink(path37));
11430
11432
  return true;
11431
11433
  }
11432
- const removedAll = (await Promise.all(entries.map((ent2) => rimrafPosixDir(resolve4(path36, ent2.name), opt, ent2)))).every((v) => v === true);
11434
+ const removedAll = (await Promise.all(entries.map((ent2) => rimrafPosixDir(resolve4(path37, ent2.name), opt, ent2)))).every((v) => v === true);
11433
11435
  if (!removedAll) {
11434
11436
  return false;
11435
11437
  }
11436
- if (opt.preserveRoot === false && path36 === parse3(path36).root) {
11438
+ if (opt.preserveRoot === false && path37 === parse3(path37).root) {
11437
11439
  return false;
11438
11440
  }
11439
- if (opt.filter && !await opt.filter(path36, ent)) {
11441
+ if (opt.filter && !await opt.filter(path37, ent)) {
11440
11442
  return false;
11441
11443
  }
11442
- await ignoreENOENT(rmdir(path36));
11444
+ await ignoreENOENT(rmdir(path37));
11443
11445
  return true;
11444
11446
  };
11445
- var rimrafPosixDirSync = (path36, opt, ent) => {
11447
+ var rimrafPosixDirSync = (path37, opt, ent) => {
11446
11448
  opt?.signal?.throwIfAborted();
11447
- const entries = ent.isDirectory() ? readdirOrErrorSync(path36) : null;
11449
+ const entries = ent.isDirectory() ? readdirOrErrorSync(path37) : null;
11448
11450
  if (!Array.isArray(entries)) {
11449
11451
  if (entries) {
11450
11452
  if (errorCode(entries) === "ENOENT") {
@@ -11454,65 +11456,65 @@ var rimrafPosixDirSync = (path36, opt, ent) => {
11454
11456
  throw entries;
11455
11457
  }
11456
11458
  }
11457
- if (opt.filter && !opt.filter(path36, ent)) {
11459
+ if (opt.filter && !opt.filter(path37, ent)) {
11458
11460
  return false;
11459
11461
  }
11460
- ignoreENOENTSync(() => unlinkSync(path36));
11462
+ ignoreENOENTSync(() => unlinkSync(path37));
11461
11463
  return true;
11462
11464
  }
11463
11465
  let removedAll = true;
11464
11466
  for (const ent2 of entries) {
11465
- const p = resolve4(path36, ent2.name);
11467
+ const p = resolve4(path37, ent2.name);
11466
11468
  removedAll = rimrafPosixDirSync(p, opt, ent2) && removedAll;
11467
11469
  }
11468
- if (opt.preserveRoot === false && path36 === parse3(path36).root) {
11470
+ if (opt.preserveRoot === false && path37 === parse3(path37).root) {
11469
11471
  return false;
11470
11472
  }
11471
11473
  if (!removedAll) {
11472
11474
  return false;
11473
11475
  }
11474
- if (opt.filter && !opt.filter(path36, ent)) {
11476
+ if (opt.filter && !opt.filter(path37, ent)) {
11475
11477
  return false;
11476
11478
  }
11477
- ignoreENOENTSync(() => rmdirSync(path36));
11479
+ ignoreENOENTSync(() => rmdirSync(path37));
11478
11480
  return true;
11479
11481
  };
11480
11482
 
11481
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/rimraf-windows.js
11483
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/rimraf-windows.js
11482
11484
  init_esm_shims();
11483
11485
  import { parse as parse6, resolve as resolve7 } from "path";
11484
11486
 
11485
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/fix-eperm.js
11487
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/fix-eperm.js
11486
11488
  init_esm_shims();
11487
11489
  var { chmod } = promises;
11488
- var fixEPERM = (fn) => async (path36) => {
11490
+ var fixEPERM = (fn) => async (path37) => {
11489
11491
  try {
11490
- return void await ignoreENOENT(fn(path36));
11492
+ return void await ignoreENOENT(fn(path37));
11491
11493
  } catch (er) {
11492
11494
  if (errorCode(er) === "EPERM") {
11493
- if (!await ignoreENOENT(chmod(path36, 438).then(() => true), er)) {
11495
+ if (!await ignoreENOENT(chmod(path37, 438).then(() => true), er)) {
11494
11496
  return;
11495
11497
  }
11496
- return void await fn(path36);
11498
+ return void await fn(path37);
11497
11499
  }
11498
11500
  throw er;
11499
11501
  }
11500
11502
  };
11501
- var fixEPERMSync = (fn) => (path36) => {
11503
+ var fixEPERMSync = (fn) => (path37) => {
11502
11504
  try {
11503
- return void ignoreENOENTSync(() => fn(path36));
11505
+ return void ignoreENOENTSync(() => fn(path37));
11504
11506
  } catch (er) {
11505
11507
  if (errorCode(er) === "EPERM") {
11506
- if (!ignoreENOENTSync(() => (chmodSync(path36, 438), true), er)) {
11508
+ if (!ignoreENOENTSync(() => (chmodSync(path37, 438), true), er)) {
11507
11509
  return;
11508
11510
  }
11509
- return void fn(path36);
11511
+ return void fn(path37);
11510
11512
  }
11511
11513
  throw er;
11512
11514
  }
11513
11515
  };
11514
11516
 
11515
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/retry-busy.js
11517
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/retry-busy.js
11516
11518
  init_esm_shims();
11517
11519
  import { setTimeout as setTimeout2 } from "timers/promises";
11518
11520
  var MAXBACKOFF = 200;
@@ -11520,21 +11522,21 @@ var RATE = 1.2;
11520
11522
  var MAXRETRIES = 10;
11521
11523
  var codes = /* @__PURE__ */ new Set(["EMFILE", "ENFILE", "EBUSY"]);
11522
11524
  var retryBusy = (fn) => {
11523
- const method = async (path36, opt, backoff = 1, total = 0) => {
11525
+ const method = async (path37, opt, backoff = 1, total = 0) => {
11524
11526
  const mbo = opt.maxBackoff || MAXBACKOFF;
11525
11527
  const rate = opt.backoff || RATE;
11526
11528
  const max = opt.maxRetries || MAXRETRIES;
11527
11529
  let retries = 0;
11528
11530
  while (true) {
11529
11531
  try {
11530
- return await fn(path36);
11532
+ return await fn(path37);
11531
11533
  } catch (er) {
11532
- if (isFsError(er) && er.path === path36 && codes.has(er.code)) {
11534
+ if (isFsError(er) && er.path === path37 && codes.has(er.code)) {
11533
11535
  backoff = Math.ceil(backoff * rate);
11534
11536
  total = backoff + total;
11535
11537
  if (total < mbo) {
11536
11538
  await setTimeout2(backoff);
11537
- return method(path36, opt, backoff, total);
11539
+ return method(path37, opt, backoff, total);
11538
11540
  }
11539
11541
  if (retries < max) {
11540
11542
  retries++;
@@ -11548,14 +11550,14 @@ var retryBusy = (fn) => {
11548
11550
  return method;
11549
11551
  };
11550
11552
  var retryBusySync = (fn) => {
11551
- const method = (path36, opt) => {
11553
+ const method = (path37, opt) => {
11552
11554
  const max = opt.maxRetries || MAXRETRIES;
11553
11555
  let retries = 0;
11554
11556
  while (true) {
11555
11557
  try {
11556
- return fn(path36);
11558
+ return fn(path37);
11557
11559
  } catch (er) {
11558
- if (isFsError(er) && er.path === path36 && codes.has(er.code) && retries < max) {
11560
+ if (isFsError(er) && er.path === path37 && codes.has(er.code) && retries < max) {
11559
11561
  retries++;
11560
11562
  continue;
11561
11563
  }
@@ -11566,25 +11568,25 @@ var retryBusySync = (fn) => {
11566
11568
  return method;
11567
11569
  };
11568
11570
 
11569
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/rimraf-move-remove.js
11571
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/rimraf-move-remove.js
11570
11572
  init_esm_shims();
11571
11573
  import { basename as basename3, parse as parse5, resolve as resolve6 } from "path";
11572
11574
 
11573
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/default-tmp.js
11575
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/default-tmp.js
11574
11576
  init_esm_shims();
11575
11577
  import { tmpdir } from "os";
11576
11578
  import { parse as parse4, resolve as resolve5 } from "path";
11577
11579
  var { stat: stat4 } = promises;
11578
- var isDirSync = (path36) => {
11580
+ var isDirSync = (path37) => {
11579
11581
  try {
11580
- return statSync(path36).isDirectory();
11582
+ return statSync(path37).isDirectory();
11581
11583
  } catch {
11582
11584
  return false;
11583
11585
  }
11584
11586
  };
11585
- var isDir = (path36) => stat4(path36).then((st) => st.isDirectory(), () => false);
11586
- var win32DefaultTmp = async (path36) => {
11587
- const { root } = parse4(path36);
11587
+ var isDir = (path37) => stat4(path37).then((st) => st.isDirectory(), () => false);
11588
+ var win32DefaultTmp = async (path37) => {
11589
+ const { root } = parse4(path37);
11588
11590
  const tmp = tmpdir();
11589
11591
  const { root: tmpRoot } = parse4(tmp);
11590
11592
  if (root.toLowerCase() === tmpRoot.toLowerCase()) {
@@ -11596,8 +11598,8 @@ var win32DefaultTmp = async (path36) => {
11596
11598
  }
11597
11599
  return root;
11598
11600
  };
11599
- var win32DefaultTmpSync = (path36) => {
11600
- const { root } = parse4(path36);
11601
+ var win32DefaultTmpSync = (path37) => {
11602
+ const { root } = parse4(path37);
11601
11603
  const tmp = tmpdir();
11602
11604
  const { root: tmpRoot } = parse4(tmp);
11603
11605
  if (root.toLowerCase() === tmpRoot.toLowerCase()) {
@@ -11614,24 +11616,24 @@ var posixDefaultTmpSync = () => tmpdir();
11614
11616
  var defaultTmp = process.platform === "win32" ? win32DefaultTmp : posixDefaultTmp;
11615
11617
  var defaultTmpSync = process.platform === "win32" ? win32DefaultTmpSync : posixDefaultTmpSync;
11616
11618
 
11617
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/rimraf-move-remove.js
11619
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/rimraf-move-remove.js
11618
11620
  var { lstat: lstat5, rename, unlink: unlink2, rmdir: rmdir2 } = promises;
11619
- var uniqueFilename = (path36) => `.${basename3(path36)}.${Math.random()}`;
11621
+ var uniqueFilename = (path37) => `.${basename3(path37)}.${Math.random()}`;
11620
11622
  var unlinkFixEPERM = fixEPERM(unlink2);
11621
11623
  var unlinkFixEPERMSync = fixEPERMSync(unlinkSync);
11622
- var rimrafMoveRemove = async (path36, opt) => {
11624
+ var rimrafMoveRemove = async (path37, opt) => {
11623
11625
  opt?.signal?.throwIfAborted();
11624
- return await ignoreENOENT(lstat5(path36).then((stat5) => rimrafMoveRemoveDir(path36, opt, stat5))) ?? true;
11626
+ return await ignoreENOENT(lstat5(path37).then((stat5) => rimrafMoveRemoveDir(path37, opt, stat5))) ?? true;
11625
11627
  };
11626
- var rimrafMoveRemoveDir = async (path36, opt, ent) => {
11628
+ var rimrafMoveRemoveDir = async (path37, opt, ent) => {
11627
11629
  opt?.signal?.throwIfAborted();
11628
11630
  if (!opt.tmp) {
11629
- return rimrafMoveRemoveDir(path36, { ...opt, tmp: await defaultTmp(path36) }, ent);
11631
+ return rimrafMoveRemoveDir(path37, { ...opt, tmp: await defaultTmp(path37) }, ent);
11630
11632
  }
11631
- if (path36 === opt.tmp && parse5(path36).root !== path36) {
11633
+ if (path37 === opt.tmp && parse5(path37).root !== path37) {
11632
11634
  throw new Error("cannot delete temp directory used for deletion");
11633
11635
  }
11634
- const entries = ent.isDirectory() ? await readdirOrError(path36) : null;
11636
+ const entries = ent.isDirectory() ? await readdirOrError(path37) : null;
11635
11637
  if (!Array.isArray(entries)) {
11636
11638
  if (entries) {
11637
11639
  if (errorCode(entries) === "ENOENT") {
@@ -11641,44 +11643,44 @@ var rimrafMoveRemoveDir = async (path36, opt, ent) => {
11641
11643
  throw entries;
11642
11644
  }
11643
11645
  }
11644
- if (opt.filter && !await opt.filter(path36, ent)) {
11646
+ if (opt.filter && !await opt.filter(path37, ent)) {
11645
11647
  return false;
11646
11648
  }
11647
- await ignoreENOENT(tmpUnlink(path36, opt.tmp, unlinkFixEPERM));
11649
+ await ignoreENOENT(tmpUnlink(path37, opt.tmp, unlinkFixEPERM));
11648
11650
  return true;
11649
11651
  }
11650
- const removedAll = (await Promise.all(entries.map((ent2) => rimrafMoveRemoveDir(resolve6(path36, ent2.name), opt, ent2)))).every((v) => v === true);
11652
+ const removedAll = (await Promise.all(entries.map((ent2) => rimrafMoveRemoveDir(resolve6(path37, ent2.name), opt, ent2)))).every((v) => v === true);
11651
11653
  if (!removedAll) {
11652
11654
  return false;
11653
11655
  }
11654
- if (opt.preserveRoot === false && path36 === parse5(path36).root) {
11656
+ if (opt.preserveRoot === false && path37 === parse5(path37).root) {
11655
11657
  return false;
11656
11658
  }
11657
- if (opt.filter && !await opt.filter(path36, ent)) {
11659
+ if (opt.filter && !await opt.filter(path37, ent)) {
11658
11660
  return false;
11659
11661
  }
11660
- await ignoreENOENT(tmpUnlink(path36, opt.tmp, rmdir2));
11662
+ await ignoreENOENT(tmpUnlink(path37, opt.tmp, rmdir2));
11661
11663
  return true;
11662
11664
  };
11663
- var tmpUnlink = async (path36, tmp, rm2) => {
11664
- const tmpFile = resolve6(tmp, uniqueFilename(path36));
11665
- await rename(path36, tmpFile);
11665
+ var tmpUnlink = async (path37, tmp, rm2) => {
11666
+ const tmpFile = resolve6(tmp, uniqueFilename(path37));
11667
+ await rename(path37, tmpFile);
11666
11668
  return await rm2(tmpFile);
11667
11669
  };
11668
- var rimrafMoveRemoveSync = (path36, opt) => {
11670
+ var rimrafMoveRemoveSync = (path37, opt) => {
11669
11671
  opt?.signal?.throwIfAborted();
11670
- return ignoreENOENTSync(() => rimrafMoveRemoveDirSync(path36, opt, lstatSync2(path36))) ?? true;
11672
+ return ignoreENOENTSync(() => rimrafMoveRemoveDirSync(path37, opt, lstatSync2(path37))) ?? true;
11671
11673
  };
11672
- var rimrafMoveRemoveDirSync = (path36, opt, ent) => {
11674
+ var rimrafMoveRemoveDirSync = (path37, opt, ent) => {
11673
11675
  opt?.signal?.throwIfAborted();
11674
11676
  if (!opt.tmp) {
11675
- return rimrafMoveRemoveDirSync(path36, { ...opt, tmp: defaultTmpSync(path36) }, ent);
11677
+ return rimrafMoveRemoveDirSync(path37, { ...opt, tmp: defaultTmpSync(path37) }, ent);
11676
11678
  }
11677
11679
  const tmp = opt.tmp;
11678
- if (path36 === opt.tmp && parse5(path36).root !== path36) {
11680
+ if (path37 === opt.tmp && parse5(path37).root !== path37) {
11679
11681
  throw new Error("cannot delete temp directory used for deletion");
11680
11682
  }
11681
- const entries = ent.isDirectory() ? readdirOrErrorSync(path36) : null;
11683
+ const entries = ent.isDirectory() ? readdirOrErrorSync(path37) : null;
11682
11684
  if (!Array.isArray(entries)) {
11683
11685
  if (entries) {
11684
11686
  if (errorCode(entries) === "ENOENT") {
@@ -11688,61 +11690,61 @@ var rimrafMoveRemoveDirSync = (path36, opt, ent) => {
11688
11690
  throw entries;
11689
11691
  }
11690
11692
  }
11691
- if (opt.filter && !opt.filter(path36, ent)) {
11693
+ if (opt.filter && !opt.filter(path37, ent)) {
11692
11694
  return false;
11693
11695
  }
11694
- ignoreENOENTSync(() => tmpUnlinkSync(path36, tmp, unlinkFixEPERMSync));
11696
+ ignoreENOENTSync(() => tmpUnlinkSync(path37, tmp, unlinkFixEPERMSync));
11695
11697
  return true;
11696
11698
  }
11697
11699
  let removedAll = true;
11698
11700
  for (const ent2 of entries) {
11699
- const p = resolve6(path36, ent2.name);
11701
+ const p = resolve6(path37, ent2.name);
11700
11702
  removedAll = rimrafMoveRemoveDirSync(p, opt, ent2) && removedAll;
11701
11703
  }
11702
11704
  if (!removedAll) {
11703
11705
  return false;
11704
11706
  }
11705
- if (opt.preserveRoot === false && path36 === parse5(path36).root) {
11707
+ if (opt.preserveRoot === false && path37 === parse5(path37).root) {
11706
11708
  return false;
11707
11709
  }
11708
- if (opt.filter && !opt.filter(path36, ent)) {
11710
+ if (opt.filter && !opt.filter(path37, ent)) {
11709
11711
  return false;
11710
11712
  }
11711
- ignoreENOENTSync(() => tmpUnlinkSync(path36, tmp, rmdirSync));
11713
+ ignoreENOENTSync(() => tmpUnlinkSync(path37, tmp, rmdirSync));
11712
11714
  return true;
11713
11715
  };
11714
- var tmpUnlinkSync = (path36, tmp, rmSync2) => {
11715
- const tmpFile = resolve6(tmp, uniqueFilename(path36));
11716
- renameSync(path36, tmpFile);
11716
+ var tmpUnlinkSync = (path37, tmp, rmSync2) => {
11717
+ const tmpFile = resolve6(tmp, uniqueFilename(path37));
11718
+ renameSync(path37, tmpFile);
11717
11719
  return rmSync2(tmpFile);
11718
11720
  };
11719
11721
 
11720
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/rimraf-windows.js
11722
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/rimraf-windows.js
11721
11723
  var { unlink: unlink3, rmdir: rmdir3, lstat: lstat6 } = promises;
11722
11724
  var rimrafWindowsFile = retryBusy(fixEPERM(unlink3));
11723
11725
  var rimrafWindowsFileSync = retryBusySync(fixEPERMSync(unlinkSync));
11724
11726
  var rimrafWindowsDirRetry = retryBusy(fixEPERM(rmdir3));
11725
11727
  var rimrafWindowsDirRetrySync = retryBusySync(fixEPERMSync(rmdirSync));
11726
- var rimrafWindowsDirMoveRemoveFallback = async (path36, { filter: filter3, ...opt }) => {
11728
+ var rimrafWindowsDirMoveRemoveFallback = async (path37, { filter: filter3, ...opt }) => {
11727
11729
  opt?.signal?.throwIfAborted();
11728
11730
  try {
11729
- await rimrafWindowsDirRetry(path36, opt);
11731
+ await rimrafWindowsDirRetry(path37, opt);
11730
11732
  return true;
11731
11733
  } catch (er) {
11732
11734
  if (errorCode(er) === "ENOTEMPTY") {
11733
- return rimrafMoveRemove(path36, opt);
11735
+ return rimrafMoveRemove(path37, opt);
11734
11736
  }
11735
11737
  throw er;
11736
11738
  }
11737
11739
  };
11738
- var rimrafWindowsDirMoveRemoveFallbackSync = (path36, { filter: filter3, ...opt }) => {
11740
+ var rimrafWindowsDirMoveRemoveFallbackSync = (path37, { filter: filter3, ...opt }) => {
11739
11741
  opt?.signal?.throwIfAborted();
11740
11742
  try {
11741
- rimrafWindowsDirRetrySync(path36, opt);
11743
+ rimrafWindowsDirRetrySync(path37, opt);
11742
11744
  return true;
11743
11745
  } catch (er) {
11744
11746
  if (errorCode(er) === "ENOTEMPTY") {
11745
- return rimrafMoveRemoveSync(path36, opt);
11747
+ return rimrafMoveRemoveSync(path37, opt);
11746
11748
  }
11747
11749
  throw er;
11748
11750
  }
@@ -11750,17 +11752,17 @@ var rimrafWindowsDirMoveRemoveFallbackSync = (path36, { filter: filter3, ...opt
11750
11752
  var START = Symbol("start");
11751
11753
  var CHILD = Symbol("child");
11752
11754
  var FINISH = Symbol("finish");
11753
- var rimrafWindows = async (path36, opt) => {
11755
+ var rimrafWindows = async (path37, opt) => {
11754
11756
  opt?.signal?.throwIfAborted();
11755
- return await ignoreENOENT(lstat6(path36).then((stat5) => rimrafWindowsDir(path36, opt, stat5, START))) ?? true;
11757
+ return await ignoreENOENT(lstat6(path37).then((stat5) => rimrafWindowsDir(path37, opt, stat5, START))) ?? true;
11756
11758
  };
11757
- var rimrafWindowsSync = (path36, opt) => {
11759
+ var rimrafWindowsSync = (path37, opt) => {
11758
11760
  opt?.signal?.throwIfAborted();
11759
- return ignoreENOENTSync(() => rimrafWindowsDirSync(path36, opt, lstatSync2(path36), START)) ?? true;
11761
+ return ignoreENOENTSync(() => rimrafWindowsDirSync(path37, opt, lstatSync2(path37), START)) ?? true;
11760
11762
  };
11761
- var rimrafWindowsDir = async (path36, opt, ent, state = START) => {
11763
+ var rimrafWindowsDir = async (path37, opt, ent, state = START) => {
11762
11764
  opt?.signal?.throwIfAborted();
11763
- const entries = ent.isDirectory() ? await readdirOrError(path36) : null;
11765
+ const entries = ent.isDirectory() ? await readdirOrError(path37) : null;
11764
11766
  if (!Array.isArray(entries)) {
11765
11767
  if (entries) {
11766
11768
  if (errorCode(entries) === "ENOENT") {
@@ -11770,32 +11772,32 @@ var rimrafWindowsDir = async (path36, opt, ent, state = START) => {
11770
11772
  throw entries;
11771
11773
  }
11772
11774
  }
11773
- if (opt.filter && !await opt.filter(path36, ent)) {
11775
+ if (opt.filter && !await opt.filter(path37, ent)) {
11774
11776
  return false;
11775
11777
  }
11776
- await ignoreENOENT(rimrafWindowsFile(path36, opt));
11778
+ await ignoreENOENT(rimrafWindowsFile(path37, opt));
11777
11779
  return true;
11778
11780
  }
11779
11781
  const s = state === START ? CHILD : state;
11780
- const removedAll = (await Promise.all(entries.map((ent2) => rimrafWindowsDir(resolve7(path36, ent2.name), opt, ent2, s)))).every((v) => v === true);
11782
+ const removedAll = (await Promise.all(entries.map((ent2) => rimrafWindowsDir(resolve7(path37, ent2.name), opt, ent2, s)))).every((v) => v === true);
11781
11783
  if (state === START) {
11782
- return rimrafWindowsDir(path36, opt, ent, FINISH);
11784
+ return rimrafWindowsDir(path37, opt, ent, FINISH);
11783
11785
  } else if (state === FINISH) {
11784
- if (opt.preserveRoot === false && path36 === parse6(path36).root) {
11786
+ if (opt.preserveRoot === false && path37 === parse6(path37).root) {
11785
11787
  return false;
11786
11788
  }
11787
11789
  if (!removedAll) {
11788
11790
  return false;
11789
11791
  }
11790
- if (opt.filter && !await opt.filter(path36, ent)) {
11792
+ if (opt.filter && !await opt.filter(path37, ent)) {
11791
11793
  return false;
11792
11794
  }
11793
- await ignoreENOENT(rimrafWindowsDirMoveRemoveFallback(path36, opt));
11795
+ await ignoreENOENT(rimrafWindowsDirMoveRemoveFallback(path37, opt));
11794
11796
  }
11795
11797
  return true;
11796
11798
  };
11797
- var rimrafWindowsDirSync = (path36, opt, ent, state = START) => {
11798
- const entries = ent.isDirectory() ? readdirOrErrorSync(path36) : null;
11799
+ var rimrafWindowsDirSync = (path37, opt, ent, state = START) => {
11800
+ const entries = ent.isDirectory() ? readdirOrErrorSync(path37) : null;
11799
11801
  if (!Array.isArray(entries)) {
11800
11802
  if (entries) {
11801
11803
  if (errorCode(entries) === "ENOENT") {
@@ -11805,52 +11807,52 @@ var rimrafWindowsDirSync = (path36, opt, ent, state = START) => {
11805
11807
  throw entries;
11806
11808
  }
11807
11809
  }
11808
- if (opt.filter && !opt.filter(path36, ent)) {
11810
+ if (opt.filter && !opt.filter(path37, ent)) {
11809
11811
  return false;
11810
11812
  }
11811
- ignoreENOENTSync(() => rimrafWindowsFileSync(path36, opt));
11813
+ ignoreENOENTSync(() => rimrafWindowsFileSync(path37, opt));
11812
11814
  return true;
11813
11815
  }
11814
11816
  let removedAll = true;
11815
11817
  for (const ent2 of entries) {
11816
11818
  const s = state === START ? CHILD : state;
11817
- const p = resolve7(path36, ent2.name);
11819
+ const p = resolve7(path37, ent2.name);
11818
11820
  removedAll = rimrafWindowsDirSync(p, opt, ent2, s) && removedAll;
11819
11821
  }
11820
11822
  if (state === START) {
11821
- return rimrafWindowsDirSync(path36, opt, ent, FINISH);
11823
+ return rimrafWindowsDirSync(path37, opt, ent, FINISH);
11822
11824
  } else if (state === FINISH) {
11823
- if (opt.preserveRoot === false && path36 === parse6(path36).root) {
11825
+ if (opt.preserveRoot === false && path37 === parse6(path37).root) {
11824
11826
  return false;
11825
11827
  }
11826
11828
  if (!removedAll) {
11827
11829
  return false;
11828
11830
  }
11829
- if (opt.filter && !opt.filter(path36, ent)) {
11831
+ if (opt.filter && !opt.filter(path37, ent)) {
11830
11832
  return false;
11831
11833
  }
11832
- ignoreENOENTSync(() => rimrafWindowsDirMoveRemoveFallbackSync(path36, opt));
11834
+ ignoreENOENTSync(() => rimrafWindowsDirMoveRemoveFallbackSync(path37, opt));
11833
11835
  }
11834
11836
  return true;
11835
11837
  };
11836
11838
 
11837
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/rimraf-manual.js
11839
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/rimraf-manual.js
11838
11840
  var rimrafManual = process.platform === "win32" ? rimrafWindows : rimrafPosix;
11839
11841
  var rimrafManualSync = process.platform === "win32" ? rimrafWindowsSync : rimrafPosixSync;
11840
11842
 
11841
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/rimraf-native.js
11843
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/rimraf-native.js
11842
11844
  init_esm_shims();
11843
11845
  var { rm } = promises;
11844
- var rimrafNative = async (path36, opt) => {
11845
- await rm(path36, {
11846
+ var rimrafNative = async (path37, opt) => {
11847
+ await rm(path37, {
11846
11848
  ...opt,
11847
11849
  force: true,
11848
11850
  recursive: true
11849
11851
  });
11850
11852
  return true;
11851
11853
  };
11852
- var rimrafNativeSync = (path36, opt) => {
11853
- rmSync(path36, {
11854
+ var rimrafNativeSync = (path37, opt) => {
11855
+ rmSync(path37, {
11854
11856
  ...opt,
11855
11857
  force: true,
11856
11858
  recursive: true
@@ -11858,34 +11860,34 @@ var rimrafNativeSync = (path36, opt) => {
11858
11860
  return true;
11859
11861
  };
11860
11862
 
11861
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/use-native.js
11863
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/use-native.js
11862
11864
  init_esm_shims();
11863
11865
  var [major = 0, minor = 0] = process.version.replace(/^v/, "").split(".").map((v) => parseInt(v, 10));
11864
11866
  var hasNative = major > 14 || major === 14 && minor >= 14;
11865
11867
  var useNative = !hasNative || process.platform === "win32" ? () => false : (opt) => !opt?.signal && !opt?.filter;
11866
11868
  var useNativeSync = !hasNative || process.platform === "win32" ? () => false : (opt) => !opt?.signal && !opt?.filter;
11867
11869
 
11868
- // ../../node_modules/.pnpm/rimraf@6.1.0/node_modules/rimraf/dist/esm/index.js
11869
- var wrap = (fn) => async (path36, opt) => {
11870
+ // ../../node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/index.js
11871
+ var wrap = (fn) => async (path37, opt) => {
11870
11872
  const options = optArg(opt);
11871
11873
  if (options.glob) {
11872
- path36 = await glob(path36, options.glob);
11874
+ path37 = await glob(path37, options.glob);
11873
11875
  }
11874
- if (Array.isArray(path36)) {
11875
- return !!(await Promise.all(path36.map((p) => fn(path_arg_default(p, options), options)))).reduce((a, b) => a && b, true);
11876
+ if (Array.isArray(path37)) {
11877
+ return !!(await Promise.all(path37.map((p) => fn(path_arg_default(p, options), options)))).reduce((a, b) => a && b, true);
11876
11878
  } else {
11877
- return !!await fn(path_arg_default(path36, options), options);
11879
+ return !!await fn(path_arg_default(path37, options), options);
11878
11880
  }
11879
11881
  };
11880
- var wrapSync = (fn) => (path36, opt) => {
11882
+ var wrapSync = (fn) => (path37, opt) => {
11881
11883
  const options = optArgSync(opt);
11882
11884
  if (options.glob) {
11883
- path36 = globSync(path36, options.glob);
11885
+ path37 = globSync(path37, options.glob);
11884
11886
  }
11885
- if (Array.isArray(path36)) {
11886
- return !!path36.map((p) => fn(path_arg_default(p, options), options)).reduce((a, b) => a && b, true);
11887
+ if (Array.isArray(path37)) {
11888
+ return !!path37.map((p) => fn(path_arg_default(p, options), options)).reduce((a, b) => a && b, true);
11887
11889
  } else {
11888
- return !!fn(path_arg_default(path36, options), options);
11890
+ return !!fn(path_arg_default(path37, options), options);
11889
11891
  }
11890
11892
  };
11891
11893
  var nativeSync = wrapSync(rimrafNativeSync);
@@ -11900,8 +11902,8 @@ var moveRemoveSync = wrapSync(rimrafMoveRemoveSync);
11900
11902
  var moveRemove = Object.assign(wrap(rimrafMoveRemove), {
11901
11903
  sync: moveRemoveSync
11902
11904
  });
11903
- var rimrafSync = wrapSync((path36, opt) => useNativeSync(opt) ? rimrafNativeSync(path36, opt) : rimrafManualSync(path36, opt));
11904
- var rimraf_ = wrap((path36, opt) => useNative(opt) ? rimrafNative(path36, opt) : rimrafManual(path36, opt));
11905
+ var rimrafSync = wrapSync((path37, opt) => useNativeSync(opt) ? rimrafNativeSync(path37, opt) : rimrafManualSync(path37, opt));
11906
+ var rimraf_ = wrap((path37, opt) => useNative(opt) ? rimrafNative(path37, opt) : rimrafManual(path37, opt));
11905
11907
  var rimraf = Object.assign(rimraf_, {
11906
11908
  rimraf: rimraf_,
11907
11909
  sync: rimrafSync,
@@ -12953,7 +12955,13 @@ function createBuildService(ctx) {
12953
12955
  independentBuildTasks.set(root, task);
12954
12956
  return task;
12955
12957
  }
12956
- function checkWorkersOptions() {
12958
+ function checkWorkersOptions(target = "app") {
12959
+ if (target === "plugin") {
12960
+ return {
12961
+ hasWorkersDir: false,
12962
+ workersDir: void 0
12963
+ };
12964
+ }
12957
12965
  const workersDir = scanService.workersDir;
12958
12966
  const hasWorkersDir = Boolean(workersDir);
12959
12967
  if (hasWorkersDir && configService.weappViteConfig?.worker?.entry === void 0) {
@@ -12977,12 +12985,12 @@ function createBuildService(ctx) {
12977
12985
  configService.mergeWorkers()
12978
12986
  );
12979
12987
  }
12980
- async function runDev() {
12988
+ async function runDev(target) {
12981
12989
  if (process3.env.NODE_ENV === void 0) {
12982
12990
  process3.env.NODE_ENV = "development";
12983
12991
  }
12984
- debug?.("dev build watcher start");
12985
- const { hasWorkersDir, workersDir } = checkWorkersOptions();
12992
+ debug?.(`[${target}] dev build watcher start`);
12993
+ const { hasWorkersDir, workersDir } = checkWorkersOptions(target);
12986
12994
  const buildOptions = configService.merge(
12987
12995
  void 0,
12988
12996
  createSharedBuildConfig(configService, scanService)
@@ -12990,63 +12998,57 @@ function createBuildService(ctx) {
12990
12998
  const watcherPromise = build(
12991
12999
  buildOptions
12992
13000
  );
12993
- const workerPromise = hasWorkersDir && workersDir ? devWorkers(workersDir) : Promise.resolve();
13001
+ const workerPromise = target === "app" && hasWorkersDir && workersDir ? devWorkers(workersDir) : Promise.resolve();
12994
13002
  const [watcher] = await Promise.all([watcherPromise, workerPromise]);
12995
13003
  const isTestEnv = process3.env.VITEST === "true" || process3.env.NODE_ENV === "test";
12996
- if (hasWorkersDir && workersDir) {
12997
- if (!isTestEnv) {
12998
- const absWorkerRoot = path11.resolve(configService.absoluteSrcRoot, workersDir);
12999
- const watcher2 = esm_default.watch(
13000
- absWorkerRoot,
13001
- {
13002
- persistent: true,
13003
- ignoreInitial: true
13004
- }
13005
- );
13006
- const logWorkerEvent = (type, target, level = "info") => {
13007
- if (!target) {
13008
- return;
13009
- }
13010
- const relative3 = configService.relativeCwd(target);
13011
- const message = `[workers:${type}] ${relative3}`;
13012
- if (level === "success") {
13013
- logger_default.success(message);
13014
- } else {
13015
- logger_default.info(message);
13016
- }
13017
- };
13018
- watcher2.on("all", (event, id) => {
13019
- if (!id) {
13020
- return;
13021
- }
13022
- if (event === "add") {
13023
- logWorkerEvent(event, id, "success");
13024
- void devWorkers(workersDir);
13025
- return;
13026
- }
13027
- logWorkerEvent(event, id);
13028
- });
13029
- watcher2.on("raw", (eventName, rawPath, details) => {
13030
- if (eventName !== "rename") {
13031
- return;
13032
- }
13033
- const candidate = typeof rawPath === "string" ? rawPath : rawPath && typeof rawPath.toString === "function" ? rawPath.toString() : "";
13034
- if (!candidate) {
13035
- return;
13036
- }
13037
- const baseDir = typeof details === "object" && details && "watchedPath" in details ? details.watchedPath ?? absWorkerRoot : absWorkerRoot;
13038
- const resolved = path11.isAbsolute(candidate) ? candidate : path11.resolve(baseDir, candidate);
13039
- const exists = fs6.existsSync(resolved);
13040
- if (exists) {
13041
- logWorkerEvent("rename->add", resolved);
13042
- return;
13043
- }
13044
- logWorkerEvent("rename->unlink", resolved);
13045
- });
13046
- watcherService.sidecarWatcherMap.set(absWorkerRoot, {
13047
- close: () => watcher2.close()
13048
- });
13049
- }
13004
+ if (target === "app" && hasWorkersDir && workersDir && !isTestEnv) {
13005
+ const absWorkerRoot = path11.resolve(configService.absoluteSrcRoot, workersDir);
13006
+ const workerWatcher = esm_default.watch(
13007
+ absWorkerRoot,
13008
+ {
13009
+ persistent: true,
13010
+ ignoreInitial: true
13011
+ }
13012
+ );
13013
+ const logWorkerEvent = (type, targetPath, level = "info") => {
13014
+ if (!targetPath) {
13015
+ return;
13016
+ }
13017
+ const relative3 = configService.relativeCwd(targetPath);
13018
+ const message = `[workers:${type}] ${relative3}`;
13019
+ if (level === "success") {
13020
+ logger_default.success(message);
13021
+ } else {
13022
+ logger_default.info(message);
13023
+ }
13024
+ };
13025
+ workerWatcher.on("all", (event, id) => {
13026
+ if (!id) {
13027
+ return;
13028
+ }
13029
+ if (event === "add") {
13030
+ logWorkerEvent(event, id, "success");
13031
+ void devWorkers(workersDir);
13032
+ return;
13033
+ }
13034
+ logWorkerEvent(event, id);
13035
+ });
13036
+ workerWatcher.on("raw", (eventName, rawPath, details) => {
13037
+ if (eventName !== "rename") {
13038
+ return;
13039
+ }
13040
+ const candidate = typeof rawPath === "string" ? rawPath : rawPath && typeof rawPath.toString === "function" ? rawPath.toString() : "";
13041
+ if (!candidate) {
13042
+ return;
13043
+ }
13044
+ const baseDir = typeof details === "object" && details && "watchedPath" in details ? details.watchedPath ?? absWorkerRoot : absWorkerRoot;
13045
+ const resolved = path11.isAbsolute(candidate) ? candidate : path11.resolve(baseDir, candidate);
13046
+ const exists = fs6.existsSync(resolved);
13047
+ logWorkerEvent(exists ? "rename->add" : "rename->unlink", resolved, exists ? "success" : "info");
13048
+ });
13049
+ watcherService.sidecarWatcherMap.set(absWorkerRoot, {
13050
+ close: () => workerWatcher.close()
13051
+ });
13050
13052
  }
13051
13053
  debug?.("dev build watcher end");
13052
13054
  debug?.("dev watcher listen start");
@@ -13068,24 +13070,25 @@ function createBuildService(ctx) {
13068
13070
  }
13069
13071
  });
13070
13072
  await promise;
13071
- watcherService.setRollupWatcher(watcher);
13073
+ const watcherRoot = target === "plugin" ? configService.absolutePluginRoot ?? configService.absoluteSrcRoot : "/";
13074
+ watcherService.setRollupWatcher(watcher, watcherRoot);
13072
13075
  return watcher;
13073
13076
  }
13074
- async function runProd() {
13075
- debug?.("prod build start");
13076
- const { hasWorkersDir } = checkWorkersOptions();
13077
+ async function runProd(target) {
13078
+ debug?.(`[${target}] prod build start`);
13079
+ const { hasWorkersDir } = checkWorkersOptions(target);
13077
13080
  const bundlerPromise = build(
13078
13081
  configService.merge(
13079
13082
  void 0,
13080
13083
  createSharedBuildConfig(configService, scanService)
13081
13084
  )
13082
13085
  );
13083
- const workerPromise = hasWorkersDir ? buildWorkers() : Promise.resolve();
13086
+ const workerPromise = target === "app" && hasWorkersDir ? buildWorkers() : Promise.resolve();
13084
13087
  const [output] = await Promise.all([bundlerPromise, workerPromise]);
13085
- debug?.("prod build end");
13088
+ debug?.(`[${target}] prod build end`);
13086
13089
  return output;
13087
13090
  }
13088
- async function buildEntry(options) {
13091
+ async function cleanOutputs() {
13089
13092
  if (configService.mpDistRoot) {
13090
13093
  const deletedFilePaths = await rimraf(
13091
13094
  [
@@ -13105,35 +13108,66 @@ function createBuildService(ctx) {
13105
13108
  debug?.("deletedFilePaths", deletedFilePaths);
13106
13109
  logger_default.success(`\u5DF2\u6E05\u7A7A ${configService.mpDistRoot} \u76EE\u5F55`);
13107
13110
  }
13108
- debug?.("build start");
13109
- let npmBuildTask = Promise.resolve();
13110
- if (!options?.skipNpm) {
13111
- let shouldBuildNpm = true;
13111
+ const pluginOutputRoot = configService.absolutePluginOutputRoot;
13112
+ if (pluginOutputRoot) {
13113
+ const relativeToOutDir = path11.relative(configService.outDir, pluginOutputRoot);
13114
+ const isInsideOutDir = relativeToOutDir === "" || !relativeToOutDir.startsWith("..") && !path11.isAbsolute(relativeToOutDir);
13115
+ if (!isInsideOutDir) {
13116
+ const deletedPluginFiles = await rimraf([
13117
+ path11.resolve(pluginOutputRoot, "*"),
13118
+ path11.resolve(pluginOutputRoot, ".*")
13119
+ ], {
13120
+ glob: true
13121
+ });
13122
+ debug?.("deletedPluginOutput", deletedPluginFiles);
13123
+ logger_default.success(`\u5DF2\u6E05\u7A7A ${configService.relativeCwd(pluginOutputRoot)} \u76EE\u5F55`);
13124
+ }
13125
+ }
13126
+ }
13127
+ function scheduleNpmBuild(options) {
13128
+ if (options?.skipNpm) {
13129
+ return Promise.resolve();
13130
+ }
13131
+ const runTask = () => queue.add(async () => {
13132
+ await npmService.build();
13112
13133
  if (configService.isDev) {
13134
+ buildState.npmBuilt = true;
13135
+ }
13136
+ });
13137
+ if (configService.isDev) {
13138
+ return (async () => {
13113
13139
  const isDependenciesOutdated = await npmService.checkDependenciesCacheOutdate();
13114
13140
  if (!isDependenciesOutdated && buildState.npmBuilt) {
13115
- shouldBuildNpm = false;
13116
- } else if (isDependenciesOutdated) {
13141
+ return;
13142
+ }
13143
+ if (isDependenciesOutdated) {
13117
13144
  buildState.npmBuilt = false;
13118
13145
  }
13119
- }
13120
- if (shouldBuildNpm) {
13121
- npmBuildTask = queue.add(async () => {
13122
- await npmService.build();
13123
- if (configService.isDev) {
13124
- buildState.npmBuilt = true;
13125
- }
13126
- });
13146
+ const task2 = runTask();
13127
13147
  queue.start();
13128
- }
13148
+ await task2;
13149
+ })();
13129
13150
  }
13130
- let result;
13151
+ const task = runTask();
13152
+ queue.start();
13153
+ return task;
13154
+ }
13155
+ async function runBuildTarget(target) {
13156
+ ctx.currentBuildTarget = target;
13131
13157
  if (configService.isDev) {
13132
- result = await runDev();
13133
- } else {
13134
- result = await runProd();
13158
+ return await runDev(target);
13135
13159
  }
13160
+ return await runProd(target);
13161
+ }
13162
+ async function buildEntry(options) {
13163
+ await cleanOutputs();
13164
+ debug?.("build start");
13165
+ const npmBuildTask = scheduleNpmBuild(options);
13166
+ const result = await runBuildTarget("app");
13136
13167
  await npmBuildTask;
13168
+ if (configService.absolutePluginRoot) {
13169
+ await runBuildTarget("plugin");
13170
+ }
13137
13171
  debug?.("build end");
13138
13172
  return result;
13139
13173
  }
@@ -18805,17 +18839,17 @@ function withTrailingSlash(input = "", respectQueryAndFragment) {
18805
18839
  if (hasTrailingSlash(input, true)) {
18806
18840
  return input || "/";
18807
18841
  }
18808
- let path36 = input;
18842
+ let path37 = input;
18809
18843
  let fragment = "";
18810
18844
  const fragmentIndex = input.indexOf("#");
18811
18845
  if (fragmentIndex !== -1) {
18812
- path36 = input.slice(0, fragmentIndex);
18846
+ path37 = input.slice(0, fragmentIndex);
18813
18847
  fragment = input.slice(fragmentIndex);
18814
- if (!path36) {
18848
+ if (!path37) {
18815
18849
  return fragment;
18816
18850
  }
18817
18851
  }
18818
- const [s0, ...s] = path36.split("?");
18852
+ const [s0, ...s] = path37.split("?");
18819
18853
  return s0 + "/" + (s.length > 0 ? `?${s.join("?")}` : "") + fragment;
18820
18854
  }
18821
18855
  function isNonEmptyURL(url) {
@@ -18844,8 +18878,8 @@ import path12, { dirname as dirname3 } from "path";
18844
18878
  import v8 from "v8";
18845
18879
  import { format, inspect as inspect2 } from "util";
18846
18880
  var BUILTIN_MODULES = new Set(builtinModules);
18847
- function normalizeSlash(path36) {
18848
- return path36.replace(/\\/g, "/");
18881
+ function normalizeSlash(path37) {
18882
+ return path37.replace(/\\/g, "/");
18849
18883
  }
18850
18884
  var own$1 = {}.hasOwnProperty;
18851
18885
  var classRegExp = /^([A-Z][a-z\d]*)+$/;
@@ -18958,8 +18992,8 @@ codes2.ERR_INVALID_PACKAGE_CONFIG = createError(
18958
18992
  * @param {string} [base]
18959
18993
  * @param {string} [message]
18960
18994
  */
18961
- (path36, base, message) => {
18962
- return `Invalid package config ${path36}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
18995
+ (path37, base, message) => {
18996
+ return `Invalid package config ${path37}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
18963
18997
  },
18964
18998
  Error
18965
18999
  );
@@ -18991,8 +19025,8 @@ codes2.ERR_MODULE_NOT_FOUND = createError(
18991
19025
  * @param {string} base
18992
19026
  * @param {boolean} [exactUrl]
18993
19027
  */
18994
- (path36, base, exactUrl = false) => {
18995
- return `Cannot find ${exactUrl ? "module" : "package"} '${path36}' imported from ${base}`;
19028
+ (path37, base, exactUrl = false) => {
19029
+ return `Cannot find ${exactUrl ? "module" : "package"} '${path37}' imported from ${base}`;
18996
19030
  },
18997
19031
  Error
18998
19032
  );
@@ -19043,8 +19077,8 @@ codes2.ERR_UNKNOWN_FILE_EXTENSION = createError(
19043
19077
  * @param {string} extension
19044
19078
  * @param {string} path
19045
19079
  */
19046
- (extension, path36) => {
19047
- return `Unknown file extension "${extension}" for ${path36}`;
19080
+ (extension, path37) => {
19081
+ return `Unknown file extension "${extension}" for ${path37}`;
19048
19082
  },
19049
19083
  TypeError
19050
19084
  );
@@ -19415,9 +19449,9 @@ Default "index" lookups for the main are deprecated for ES modules.`,
19415
19449
  );
19416
19450
  }
19417
19451
  }
19418
- function tryStatSync(path36) {
19452
+ function tryStatSync(path37) {
19419
19453
  try {
19420
- return statSync2(path36);
19454
+ return statSync2(path37);
19421
19455
  } catch {
19422
19456
  }
19423
19457
  }
@@ -20336,7 +20370,7 @@ function findUpSync(name, {
20336
20370
  directory = path13.dirname(directory);
20337
20371
  }
20338
20372
  }
20339
- function _resolve2(path36, options = {}) {
20373
+ function _resolve2(path37, options = {}) {
20340
20374
  if (options.platform === "auto" || !options.platform)
20341
20375
  options.platform = process4.platform === "win32" ? "win32" : "posix";
20342
20376
  if (process4.versions.pnp) {
@@ -20345,11 +20379,11 @@ function _resolve2(path36, options = {}) {
20345
20379
  paths.push(process4.cwd());
20346
20380
  const targetRequire = createRequire2(import.meta.url);
20347
20381
  try {
20348
- return targetRequire.resolve(path36, { paths });
20382
+ return targetRequire.resolve(path37, { paths });
20349
20383
  } catch {
20350
20384
  }
20351
20385
  }
20352
- const modulePath = resolvePathSync(path36, {
20386
+ const modulePath = resolvePathSync(path37, {
20353
20387
  url: options.paths
20354
20388
  });
20355
20389
  if (options.platform === "win32")
@@ -20420,10 +20454,10 @@ var findUp = quansync2({
20420
20454
  async: findUp$1
20421
20455
  });
20422
20456
  var loadPackageJSON = quansync2(function* (cwd = process4.cwd()) {
20423
- const path36 = yield findUp("package.json", { cwd });
20424
- if (!path36 || !fs8.existsSync(path36))
20457
+ const path37 = yield findUp("package.json", { cwd });
20458
+ if (!path37 || !fs8.existsSync(path37))
20425
20459
  return null;
20426
- return JSON.parse(yield readFile(path36));
20460
+ return JSON.parse(yield readFile(path37));
20427
20461
  });
20428
20462
  var loadPackageJSONSync = loadPackageJSON.sync;
20429
20463
  var isPackageListed = quansync2(function* (name, cwd) {
@@ -20595,7 +20629,7 @@ function isMetadataYarnClassic(metadataPath) {
20595
20629
  }
20596
20630
 
20597
20631
  // src/runtime/config/createConfigService.ts
20598
- import path32 from "pathe";
20632
+ import path33 from "pathe";
20599
20633
 
20600
20634
  // src/platform.ts
20601
20635
  init_esm_shims();
@@ -21447,7 +21481,7 @@ function createLoadConfig(options) {
21447
21481
  init_esm_shims();
21448
21482
  import { defu as defu4 } from "@weapp-core/shared";
21449
21483
  import { weappWebPlugin } from "@weapp-vite/web";
21450
- import path31 from "pathe";
21484
+ import path32 from "pathe";
21451
21485
 
21452
21486
  // src/plugins/index.ts
21453
21487
  init_esm_shims();
@@ -21461,7 +21495,7 @@ import path19 from "pathe";
21461
21495
  function normalizeCopyGlobs(globs) {
21462
21496
  return Array.isArray(globs) ? globs : [];
21463
21497
  }
21464
- function scanAssetFiles(configService, config) {
21498
+ function scanAssetFiles(configService, config, buildTarget) {
21465
21499
  const weappViteConfig = configService.weappViteConfig;
21466
21500
  const include = normalizeCopyGlobs(weappViteConfig?.copy?.include);
21467
21501
  const exclude = normalizeCopyGlobs(weappViteConfig?.copy?.exclude);
@@ -21475,10 +21509,16 @@ function scanAssetFiles(configService, config) {
21475
21509
  `**/*.{${defaultAssetExtensions.join(",")}}`,
21476
21510
  ...include
21477
21511
  ];
21478
- const roots = /* @__PURE__ */ new Set([configService.absoluteSrcRoot]);
21479
- if (configService.absolutePluginRoot) {
21512
+ const roots = /* @__PURE__ */ new Set();
21513
+ if (buildTarget !== "plugin") {
21514
+ roots.add(configService.absoluteSrcRoot);
21515
+ }
21516
+ if (configService.absolutePluginRoot && buildTarget === "plugin") {
21480
21517
  roots.add(configService.absolutePluginRoot);
21481
21518
  }
21519
+ if (!roots.size) {
21520
+ return Promise.resolve([]);
21521
+ }
21482
21522
  const crawlPromises = Array.from(roots).map((root) => {
21483
21523
  return new Fdir2({
21484
21524
  includeDirs: false,
@@ -21519,7 +21559,7 @@ function createAssetCollector(state) {
21519
21559
  state.pendingAssets = Promise.resolve([]);
21520
21560
  return;
21521
21561
  }
21522
- state.pendingAssets = scanAssetFiles(configService, state.resolvedConfig);
21562
+ state.pendingAssets = scanAssetFiles(configService, state.resolvedConfig, state.buildTarget);
21523
21563
  },
21524
21564
  async buildEnd() {
21525
21565
  const assets = await state.pendingAssets;
@@ -21529,7 +21569,7 @@ function createAssetCollector(state) {
21529
21569
  for (const candidate of assets) {
21530
21570
  this.emitFile({
21531
21571
  type: "asset",
21532
- fileName: configService.relativeAbsoluteSrcRoot(candidate.file),
21572
+ fileName: configService.relativeOutputPath(candidate.file),
21533
21573
  source: candidate.buffer
21534
21574
  });
21535
21575
  }
@@ -21537,7 +21577,7 @@ function createAssetCollector(state) {
21537
21577
  };
21538
21578
  }
21539
21579
  function asset(ctx) {
21540
- const state = { ctx };
21580
+ const state = { ctx, buildTarget: ctx.currentBuildTarget ?? "app" };
21541
21581
  return [createAssetCollector(state)];
21542
21582
  }
21543
21583
 
@@ -22827,7 +22867,7 @@ var MagicString = class _MagicString {
22827
22867
  };
22828
22868
 
22829
22869
  // src/plugins/core.ts
22830
- import path26 from "pathe";
22870
+ import path27 from "pathe";
22831
22871
 
22832
22872
  // src/plugins/css/shared/preprocessor.ts
22833
22873
  init_esm_shims();
@@ -23121,7 +23161,7 @@ function createChunkEmitter(configService, loadedEntrySet, debug4) {
23121
23161
  const start = performance2.now();
23122
23162
  loadedEntrySet.add(resolvedId.id);
23123
23163
  await this.load(resolvedId);
23124
- const fileName = configService.relativeAbsoluteSrcRoot(
23164
+ const fileName = configService.relativeOutputPath(
23125
23165
  changeFileExtension(resolvedId.id, ".js")
23126
23166
  );
23127
23167
  this.emitFile({
@@ -23191,7 +23231,7 @@ function createJsonEmitManager(configService) {
23191
23231
  if (!entry.jsonPath) {
23192
23232
  return;
23193
23233
  }
23194
- const fileName = configService.relativeAbsoluteSrcRoot(
23234
+ const fileName = configService.relativeOutputPath(
23195
23235
  jsonFileRemoveJsExtension(entry.jsonPath)
23196
23236
  );
23197
23237
  map.set(fileName, {
@@ -23370,8 +23410,10 @@ function createEntryLoader(options) {
23370
23410
  emitEntriesChunks,
23371
23411
  applyAutoImports,
23372
23412
  extendedLibManager,
23413
+ buildTarget,
23373
23414
  debug: debug4
23374
23415
  } = options;
23416
+ const isPluginBuild = buildTarget === "plugin";
23375
23417
  const { jsonService, configService, scanService } = ctx;
23376
23418
  const existsCache = /* @__PURE__ */ new Map();
23377
23419
  return async function loadEntry(id, type) {
@@ -23398,16 +23440,18 @@ function createEntryLoader(options) {
23398
23440
  let pluginJsonPathForRegistration;
23399
23441
  let pluginJsonForRegistration;
23400
23442
  if (type === "app") {
23401
- extendedLibManager.syncFromAppJson(json);
23402
- entries.push(...analyzeAppJson(json));
23403
- await collectAppSideFiles(
23404
- this,
23405
- id,
23406
- json,
23407
- jsonService,
23408
- registerJsonAsset,
23409
- existsCache
23410
- );
23443
+ if (!isPluginBuild) {
23444
+ extendedLibManager.syncFromAppJson(json);
23445
+ entries.push(...analyzeAppJson(json));
23446
+ await collectAppSideFiles(
23447
+ this,
23448
+ id,
23449
+ json,
23450
+ jsonService,
23451
+ registerJsonAsset,
23452
+ existsCache
23453
+ );
23454
+ }
23411
23455
  const pluginJsonPath = scanService?.pluginJsonPath;
23412
23456
  if (configService.absolutePluginRoot && pluginJsonPath) {
23413
23457
  this.addWatchFile(pluginJsonPath);
@@ -23441,25 +23485,27 @@ function createEntryLoader(options) {
23441
23485
  applyAutoImports(baseName, json);
23442
23486
  entries.push(...analyzeCommonJson(json));
23443
23487
  }
23444
- const filteredEntries = entries.filter((entry) => !extendedLibManager.shouldIgnoreEntry(entry));
23445
- const normalizedEntries = filteredEntries.map((entry) => normalizeEntry(entry, jsonPath));
23446
- for (const normalizedEntry of normalizedEntries) {
23447
- entriesMap.set(normalizedEntry, {
23448
- type: json.component ? "component" : "page",
23449
- templatePath,
23450
- jsonPath,
23451
- json,
23452
- path: id
23453
- });
23488
+ const filteredEntries = isPluginBuild ? [] : entries.filter((entry) => !extendedLibManager.shouldIgnoreEntry(entry));
23489
+ const normalizedEntries = isPluginBuild ? [] : filteredEntries.map((entry) => normalizeEntry(entry, jsonPath));
23490
+ if (!isPluginBuild) {
23491
+ for (const normalizedEntry of normalizedEntries) {
23492
+ entriesMap.set(normalizedEntry, {
23493
+ type: json.component ? "component" : "page",
23494
+ templatePath,
23495
+ jsonPath,
23496
+ json,
23497
+ path: id
23498
+ });
23499
+ }
23454
23500
  }
23455
- const resolvedIds = await resolveEntries.call(
23501
+ const resolvedIds = normalizedEntries.length ? await resolveEntries.call(
23456
23502
  this,
23457
23503
  normalizedEntries,
23458
23504
  configService.absoluteSrcRoot
23459
- );
23505
+ ) : [];
23460
23506
  debug4?.(`resolvedIds ${relativeCwdId} \u8017\u65F6 ${getTime()}`);
23461
23507
  const pendingResolvedIds = [];
23462
- const combinedResolved = pluginResolvedRecords ? [...resolvedIds, ...pluginResolvedRecords] : resolvedIds;
23508
+ const combinedResolved = pluginResolvedRecords ? isPluginBuild ? pluginResolvedRecords : [...resolvedIds, ...pluginResolvedRecords] : resolvedIds;
23463
23509
  const pluginEntrySet = pluginResolvedRecords ? new Set(pluginResolvedRecords.map((record) => record.entry)) : void 0;
23464
23510
  for (const { entry, resolvedId } of combinedResolved) {
23465
23511
  if (!resolvedId) {
@@ -23479,11 +23525,13 @@ function createEntryLoader(options) {
23479
23525
  await Promise.all(emitEntriesChunks.call(this, pendingResolvedIds));
23480
23526
  }
23481
23527
  debug4?.(`emitEntriesChunks ${relativeCwdId} \u8017\u65F6 ${getTime()}`);
23482
- registerJsonAsset({
23483
- jsonPath,
23484
- json,
23485
- type
23486
- });
23528
+ if (!isPluginBuild) {
23529
+ registerJsonAsset({
23530
+ jsonPath,
23531
+ json,
23532
+ type
23533
+ });
23534
+ }
23487
23535
  if (pluginJsonPathForRegistration && pluginJsonForRegistration) {
23488
23536
  registerJsonAsset({
23489
23537
  jsonPath: pluginJsonPathForRegistration,
@@ -23569,8 +23617,9 @@ function createTemplateScanner(wxmlService, debug4) {
23569
23617
  }
23570
23618
 
23571
23619
  // src/plugins/hooks/useLoadEntry/index.ts
23572
- function useLoadEntry(ctx) {
23620
+ function useLoadEntry(ctx, options) {
23573
23621
  const debug4 = createDebugger("weapp-vite:load-entry");
23622
+ const buildTarget = options?.buildTarget ?? "app";
23574
23623
  const entriesMap = /* @__PURE__ */ new Map();
23575
23624
  const loadedEntrySet = /* @__PURE__ */ new Set();
23576
23625
  const jsonEmitManager = createJsonEmitManager(ctx.configService);
@@ -23590,6 +23639,7 @@ function useLoadEntry(ctx) {
23590
23639
  emitEntriesChunks,
23591
23640
  applyAutoImports,
23592
23641
  extendedLibManager,
23642
+ buildTarget,
23593
23643
  debug: debug4
23594
23644
  });
23595
23645
  return {
@@ -23637,6 +23687,7 @@ var watchedCssExts = new Set(supportedCssLangs.map((ext2) => `.${ext2}`));
23637
23687
  var watchedTemplateExts = new Set(templateExtensions.map((ext2) => `.${ext2}`));
23638
23688
  var configSuffixes = configExtensions.map((ext2) => `.${ext2}`);
23639
23689
  var sidecarSuffixes = [...configSuffixes, ...watchedCssExts, ...watchedTemplateExts];
23690
+ var defaultIgnoredDirNames = /* @__PURE__ */ new Set(["node_modules", "miniprogram_npm", ".git", ".hg", ".svn", ".turbo"]);
23640
23691
  var watchLimitErrorCodes = /* @__PURE__ */ new Set(["EMFILE", "ENOSPC"]);
23641
23692
  var importProtocols = /^(?:https?:|data:|blob:|\/)/i;
23642
23693
  var cssImportRE = /@(?:import|wv-keep-import)\s+(?:url\()?['"]?([^'")\s]+)['"]?\)?/gi;
@@ -23945,13 +23996,15 @@ function ensureSidecarWatcher(ctx, rootDir) {
23945
23996
  ...supportedCssLangs.map((ext2) => path25.join(absRoot, `**/*.${ext2}`)),
23946
23997
  ...templateExtensions.map((ext2) => path25.join(absRoot, `**/*.${ext2}`))
23947
23998
  ];
23999
+ const ignoredMatcher = createSidecarIgnoredMatcher(ctx, absRoot);
23948
24000
  const watcher = esm_default.watch(patterns, {
23949
24001
  ignoreInitial: false,
23950
24002
  persistent: true,
23951
24003
  awaitWriteFinish: {
23952
24004
  stabilityThreshold: 100,
23953
24005
  pollInterval: 20
23954
- }
24006
+ },
24007
+ ignored: ignoredMatcher
23955
24008
  });
23956
24009
  const forwardChange = (event, input, options) => {
23957
24010
  if (!input) {
@@ -23963,9 +24016,9 @@ function ensureSidecarWatcher(ctx, rootDir) {
23963
24016
  }
23964
24017
  handleSidecarChange(event, normalizedPath, isReady);
23965
24018
  };
23966
- watcher.on("add", (path36) => forwardChange("create", path36));
23967
- watcher.on("change", (path36) => forwardChange("update", path36));
23968
- watcher.on("unlink", (path36) => forwardChange("delete", path36));
24019
+ watcher.on("add", (path37) => forwardChange("create", path37));
24020
+ watcher.on("change", (path37) => forwardChange("update", path37));
24021
+ watcher.on("unlink", (path37) => forwardChange("delete", path37));
23969
24022
  watcher.on("raw", (eventName, rawPath, details) => {
23970
24023
  if (eventName !== "rename") {
23971
24024
  return;
@@ -23997,6 +24050,31 @@ function ensureSidecarWatcher(ctx, rootDir) {
23997
24050
  close: () => void watcher.close()
23998
24051
  });
23999
24052
  }
24053
+ function createSidecarIgnoredMatcher(ctx, rootDir) {
24054
+ const configService = ctx.configService;
24055
+ const ignoredRoots = /* @__PURE__ */ new Set();
24056
+ const normalizedRoot = path25.normalize(rootDir);
24057
+ for (const dirName of defaultIgnoredDirNames) {
24058
+ ignoredRoots.add(path25.join(normalizedRoot, dirName));
24059
+ }
24060
+ if (configService?.mpDistRoot) {
24061
+ ignoredRoots.add(path25.resolve(configService.cwd, configService.mpDistRoot));
24062
+ } else {
24063
+ ignoredRoots.add(path25.join(normalizedRoot, "dist"));
24064
+ }
24065
+ if (configService?.outDir) {
24066
+ ignoredRoots.add(path25.resolve(configService.cwd, configService.outDir));
24067
+ }
24068
+ return (candidate) => {
24069
+ const normalized = path25.normalize(candidate);
24070
+ for (const ignored of ignoredRoots) {
24071
+ if (normalized === ignored || normalized.startsWith(`${ignored}${path25.sep}`)) {
24072
+ return true;
24073
+ }
24074
+ }
24075
+ return false;
24076
+ };
24077
+ }
24000
24078
 
24001
24079
  // src/plugins/utils/parse.ts
24002
24080
  init_esm_shims();
@@ -24020,6 +24098,7 @@ function getCssRealPath(res) {
24020
24098
 
24021
24099
  // src/plugins/utils/wxmlEmit.ts
24022
24100
  init_esm_shims();
24101
+ import path26 from "pathe";
24023
24102
 
24024
24103
  // src/wxml/handle.ts
24025
24104
  init_esm_shims();
@@ -24262,7 +24341,7 @@ ${result.code}`);
24262
24341
 
24263
24342
  // src/plugins/utils/wxmlEmit.ts
24264
24343
  function emitWxmlAssetsWithCache(options) {
24265
- const { runtime, compiler, subPackageMeta, emittedCodeCache } = options;
24344
+ const { runtime, compiler, subPackageMeta, emittedCodeCache, buildTarget = "app" } = options;
24266
24345
  const { wxmlService, configService, scanService } = compiler;
24267
24346
  if (!wxmlService || !configService || !scanService) {
24268
24347
  throw new Error("emitWxmlAssets requires wxmlService, configService and scanService to be initialized");
@@ -24271,12 +24350,20 @@ function emitWxmlAssetsWithCache(options) {
24271
24350
  return {
24272
24351
  id,
24273
24352
  token,
24274
- fileName: configService.relativeAbsoluteSrcRoot(id)
24353
+ fileName: configService.relativeOutputPath(id)
24275
24354
  };
24276
24355
  }).filter(({ fileName }) => {
24277
24356
  if (subPackageMeta) {
24278
24357
  return fileName.startsWith(subPackageMeta.subPackage.root);
24279
24358
  }
24359
+ if (buildTarget === "plugin") {
24360
+ const pluginRoot = configService.absolutePluginRoot;
24361
+ if (!pluginRoot) {
24362
+ return false;
24363
+ }
24364
+ const pluginBase = path26.basename(pluginRoot);
24365
+ return fileName.startsWith(pluginBase);
24366
+ }
24280
24367
  return scanService.isMainPackageFileName(fileName);
24281
24368
  });
24282
24369
  const emittedFiles = [];
@@ -24314,7 +24401,8 @@ function emitJsonAsset(runtime, fileName, source) {
24314
24401
  // src/plugins/core.ts
24315
24402
  var debug2 = createDebugger("weapp-vite:core");
24316
24403
  function weappVite(ctx, subPackageMeta) {
24317
- const { loadEntry, loadedEntrySet, jsonEmitFilesMap, entriesMap } = useLoadEntry(ctx);
24404
+ const buildTarget = ctx.currentBuildTarget ?? "app";
24405
+ const { loadEntry, loadedEntrySet, jsonEmitFilesMap, entriesMap } = useLoadEntry(ctx, { buildTarget });
24318
24406
  const state = {
24319
24407
  ctx,
24320
24408
  subPackageMeta,
@@ -24324,7 +24412,8 @@ function weappVite(ctx, subPackageMeta) {
24324
24412
  jsonEmitFilesMap,
24325
24413
  requireAsyncEmittedChunks: /* @__PURE__ */ new Set(),
24326
24414
  pendingIndependentBuilds: [],
24327
- watchFilesSnapshot: []
24415
+ watchFilesSnapshot: [],
24416
+ buildTarget
24328
24417
  };
24329
24418
  return [
24330
24419
  createTakeQueryPlugin(state),
@@ -24405,18 +24494,25 @@ function createWxssResolverPlugin(_state) {
24405
24494
  };
24406
24495
  }
24407
24496
  function createCoreLifecyclePlugin(state) {
24408
- const { ctx, subPackageMeta, loadEntry, loadedEntrySet } = state;
24497
+ const { ctx, subPackageMeta, loadEntry, loadedEntrySet, buildTarget } = state;
24409
24498
  const { scanService, configService, buildService } = ctx;
24499
+ const isPluginBuild = buildTarget === "plugin";
24410
24500
  return {
24411
24501
  name: "weapp-vite:pre",
24412
24502
  enforce: "pre",
24413
24503
  buildStart() {
24414
24504
  loadedEntrySet.clear();
24415
24505
  if (configService.isDev) {
24416
- const rootDir = subPackageMeta ? path26.resolve(configService.absoluteSrcRoot, subPackageMeta.subPackage.root) : configService.absoluteSrcRoot;
24417
- ensureSidecarWatcher(ctx, rootDir);
24418
- if (!subPackageMeta && configService.absolutePluginRoot) {
24419
- ensureSidecarWatcher(ctx, configService.absolutePluginRoot);
24506
+ if (isPluginBuild) {
24507
+ if (configService.absolutePluginRoot) {
24508
+ ensureSidecarWatcher(ctx, configService.absolutePluginRoot);
24509
+ }
24510
+ } else {
24511
+ const rootDir = subPackageMeta ? path27.resolve(configService.absoluteSrcRoot, subPackageMeta.subPackage.root) : configService.absoluteSrcRoot;
24512
+ ensureSidecarWatcher(ctx, rootDir);
24513
+ if (!subPackageMeta && configService.absolutePluginRoot) {
24514
+ ensureSidecarWatcher(ctx, configService.absolutePluginRoot);
24515
+ }
24420
24516
  }
24421
24517
  }
24422
24518
  },
@@ -24459,7 +24555,7 @@ function createCoreLifecyclePlugin(state) {
24459
24555
  let scannedInput;
24460
24556
  if (subPackageMeta) {
24461
24557
  scannedInput = subPackageMeta.entries.reduce((acc, entry) => {
24462
- acc[entry] = path26.resolve(configService.absoluteSrcRoot, entry);
24558
+ acc[entry] = path27.resolve(configService.absoluteSrcRoot, entry);
24463
24559
  return acc;
24464
24560
  }, {});
24465
24561
  } else {
@@ -24523,11 +24619,16 @@ function createCoreLifecyclePlugin(state) {
24523
24619
  runtime,
24524
24620
  compiler: ctx,
24525
24621
  subPackageMeta,
24526
- emittedCodeCache: ctx.runtimeState.wxml.emittedCode
24622
+ emittedCodeCache: ctx.runtimeState.wxml.emittedCode,
24623
+ buildTarget
24527
24624
  });
24528
24625
  },
24529
24626
  async generateBundle(_options, bundle) {
24530
24627
  await flushIndependentBuilds.call(this, state);
24628
+ if (isPluginBuild) {
24629
+ filterPluginBundleOutputs(bundle, configService);
24630
+ return;
24631
+ }
24531
24632
  if (!subPackageMeta) {
24532
24633
  let matchSubPackage2 = function(filePath) {
24533
24634
  return subPackageRoots.find((root) => filePath === root || filePath.startsWith(`${root}/`));
@@ -24653,7 +24754,7 @@ function createRequireAnalysisPlugin(state) {
24653
24754
  return;
24654
24755
  }
24655
24756
  for (const requireModule of requireTokens) {
24656
- const absPath = path26.resolve(path26.dirname(moduleInfo.id), requireModule.value);
24757
+ const absPath = path27.resolve(path27.dirname(moduleInfo.id), requireModule.value);
24657
24758
  const resolved = await this.resolve(absPath, moduleInfo.id);
24658
24759
  if (!resolved) {
24659
24760
  continue;
@@ -24666,7 +24767,7 @@ function createRequireAnalysisPlugin(state) {
24666
24767
  this.emitFile({
24667
24768
  type: "chunk",
24668
24769
  id: resolved.id,
24669
- fileName: configService.relativeAbsoluteSrcRoot(
24770
+ fileName: configService.relativeOutputPath(
24670
24771
  changeFileExtension(resolved.id, ".js")
24671
24772
  ),
24672
24773
  preserveSignature: "exports-only"
@@ -24690,6 +24791,17 @@ function formatBytes(bytes) {
24690
24791
  const formatted = value.toFixed(precision).replace(/\.0+$/, "");
24691
24792
  return `${formatted} ${units[index]}`;
24692
24793
  }
24794
+ function filterPluginBundleOutputs(bundle, configService) {
24795
+ const pluginOutputRoot = configService.absolutePluginOutputRoot;
24796
+ for (const [fileName] of Object.entries(bundle)) {
24797
+ const absolute = path27.resolve(configService.outDir, fileName);
24798
+ const relative3 = pluginOutputRoot ? path27.relative(pluginOutputRoot, absolute) : "";
24799
+ const isPluginFile = pluginOutputRoot ? !relative3.startsWith("..") && !path27.isAbsolute(relative3) : fileName.startsWith(path27.basename(configService.absolutePluginRoot ?? "plugin"));
24800
+ if (!isPluginFile) {
24801
+ delete bundle[fileName];
24802
+ }
24803
+ }
24804
+ }
24693
24805
  function emitJsonAssets(state) {
24694
24806
  const { ctx } = state;
24695
24807
  const { jsonService } = ctx;
@@ -24799,8 +24911,8 @@ function resolveRelativeImport(fromFile, specifier) {
24799
24911
  if (!specifier) {
24800
24912
  return "";
24801
24913
  }
24802
- const dir = path26.posix.dirname(fromFile);
24803
- const absolute = path26.posix.resolve("/", dir, specifier);
24914
+ const dir = path27.posix.dirname(fromFile);
24915
+ const absolute = path27.posix.resolve("/", dir, specifier);
24804
24916
  return absolute.startsWith("/") ? absolute.slice(1) : absolute;
24805
24917
  }
24806
24918
  async function flushIndependentBuilds(state) {
@@ -24834,11 +24946,11 @@ async function flushIndependentBuilds(state) {
24834
24946
  // src/plugins/css.ts
24835
24947
  init_esm_shims();
24836
24948
  import fs17 from "fs-extra";
24837
- import path28 from "pathe";
24949
+ import path29 from "pathe";
24838
24950
 
24839
24951
  // src/plugins/css/shared/sharedStyles.ts
24840
24952
  init_esm_shims();
24841
- import path27 from "pathe";
24953
+ import path28 from "pathe";
24842
24954
  import picomatch2 from "picomatch";
24843
24955
  var SLASH_RE = /\\/g;
24844
24956
  function toPosixPath(value) {
@@ -24954,7 +25066,7 @@ function findSharedStylesForModule(modulePath, fileName, sharedStyles) {
24954
25066
  }
24955
25067
  function resolveImportSpecifiers(fileName, entries) {
24956
25068
  const posixFileName = toPosixPath(fileName);
24957
- const dir = path27.posix.dirname(posixFileName);
25069
+ const dir = path28.posix.dirname(posixFileName);
24958
25070
  const seen = /* @__PURE__ */ new Set();
24959
25071
  const specifiers = [];
24960
25072
  for (const entry of entries) {
@@ -24962,8 +25074,8 @@ function resolveImportSpecifiers(fileName, entries) {
24962
25074
  if (target === posixFileName) {
24963
25075
  continue;
24964
25076
  }
24965
- const relative3 = path27.posix.relative(dir, target);
24966
- let specifier = relative3 || path27.posix.basename(target);
25077
+ const relative3 = path28.posix.relative(dir, target);
25078
+ let specifier = relative3 || path28.posix.basename(target);
24967
25079
  if (!specifier || specifier === ".") {
24968
25080
  continue;
24969
25081
  }
@@ -25040,12 +25152,12 @@ async function handleBundleEntry(bundle, bundleKey, asset2, configService, share
25040
25152
  return;
25041
25153
  }
25042
25154
  const toAbsolute = (id) => {
25043
- return path28.isAbsolute(id) ? id : path28.resolve(configService.cwd, id);
25155
+ return path29.isAbsolute(id) ? id : path29.resolve(configService.cwd, id);
25044
25156
  };
25045
25157
  if (bundleKey.endsWith(".wxss")) {
25046
25158
  const [rawOriginal] = asset2.originalFileNames ?? [];
25047
- const absOriginal = rawOriginal ? toAbsolute(rawOriginal) : path28.resolve(configService.absoluteSrcRoot, bundleKey);
25048
- const fileName = configService.relativeAbsoluteSrcRoot(absOriginal);
25159
+ const absOriginal = rawOriginal ? toAbsolute(rawOriginal) : path29.resolve(configService.absoluteSrcRoot, bundleKey);
25160
+ const fileName = configService.relativeOutputPath(absOriginal);
25049
25161
  if (fileName) {
25050
25162
  emitted.add(toPosixPath(fileName));
25051
25163
  }
@@ -25074,7 +25186,7 @@ async function handleBundleEntry(bundle, bundleKey, asset2, configService, share
25074
25186
  }
25075
25187
  const modulePath = toAbsolute(originalFileName);
25076
25188
  const converted = changeFileExtension(modulePath, configService.outputExtensions.wxss);
25077
- const fileName = configService.relativeAbsoluteSrcRoot(converted);
25189
+ const fileName = configService.relativeOutputPath(converted);
25078
25190
  if (!fileName) {
25079
25191
  return;
25080
25192
  }
@@ -25155,7 +25267,7 @@ async function emitSharedStyleImportsForChunks(sharedStyles, emitted, configServ
25155
25267
  return;
25156
25268
  }
25157
25269
  const converted = changeFileExtension(moduleId, outputExtensions.wxss);
25158
- const fileName = configService.relativeAbsoluteSrcRoot(converted);
25270
+ const fileName = configService.relativeOutputPath(converted);
25159
25271
  if (!fileName) {
25160
25272
  return;
25161
25273
  }
@@ -25256,12 +25368,12 @@ init_esm_shims();
25256
25368
  import { createHash as createHash2 } from "crypto";
25257
25369
  import { removeExtension as removeExtension2 } from "@weapp-core/shared";
25258
25370
  import fs18 from "fs-extra";
25259
- import path29 from "pathe";
25371
+ import path30 from "pathe";
25260
25372
  async function resolveWorkerEntry(ctx, entry) {
25261
25373
  const { configService, scanService } = ctx;
25262
- const relativeEntryPath = path29.join(scanService.workersDir, entry);
25374
+ const relativeEntryPath = path30.join(scanService.workersDir, entry);
25263
25375
  const key = removeExtension2(relativeEntryPath);
25264
- const absoluteEntry = path29.resolve(configService.absoluteSrcRoot, relativeEntryPath);
25376
+ const absoluteEntry = path30.resolve(configService.absoluteSrcRoot, relativeEntryPath);
25265
25377
  if (isJsOrTs(entry)) {
25266
25378
  const exists = await fs18.exists(absoluteEntry);
25267
25379
  if (!exists) {
@@ -25298,12 +25410,12 @@ function createWorkerBuildPlugin(ctx) {
25298
25410
  options.chunkFileNames = (chunkInfo) => {
25299
25411
  const workersDir = scanService.workersDir ?? "";
25300
25412
  if (chunkInfo.isDynamicEntry) {
25301
- return path29.join(workersDir, "[name].js");
25413
+ return path30.join(workersDir, "[name].js");
25302
25414
  }
25303
25415
  const sourceId = chunkInfo.facadeModuleId ?? chunkInfo.moduleIds[0];
25304
25416
  const hashBase = typeof sourceId === "string" ? configService.relativeCwd(sourceId) : chunkInfo.name;
25305
25417
  const stableHash = createHash2("sha256").update(hashBase).digest("base64url").slice(0, 8);
25306
- return path29.join(workersDir, `${chunkInfo.name}-${stableHash}.js`);
25418
+ return path30.join(workersDir, `${chunkInfo.name}-${stableHash}.js`);
25307
25419
  };
25308
25420
  }
25309
25421
  };
@@ -25319,7 +25431,7 @@ function workers(ctx) {
25319
25431
  init_esm_shims();
25320
25432
  import { removeExtension as removeExtension3 } from "@weapp-core/shared";
25321
25433
  import fs19 from "fs-extra";
25322
- import path30 from "pathe";
25434
+ import path31 from "pathe";
25323
25435
  var wxsCodeCache = new LRUCache({
25324
25436
  max: 512
25325
25437
  });
@@ -25344,13 +25456,13 @@ async function transformWxsFile(state, wxsPath) {
25344
25456
  if (typeof result?.code === "string") {
25345
25457
  code = result.code;
25346
25458
  }
25347
- const dirname5 = path30.dirname(wxsPath);
25459
+ const dirname5 = path31.dirname(wxsPath);
25348
25460
  await Promise.all(
25349
25461
  importees.map(({ source }) => {
25350
25462
  return transformWxsFile.call(
25351
25463
  this,
25352
25464
  state,
25353
- path30.resolve(dirname5, source)
25465
+ path31.resolve(dirname5, source)
25354
25466
  );
25355
25467
  })
25356
25468
  );
@@ -25361,7 +25473,7 @@ async function transformWxsFile(state, wxsPath) {
25361
25473
  state.wxsMap.set(wxsPath, {
25362
25474
  emittedFile: {
25363
25475
  type: "asset",
25364
- fileName: configService.relativeAbsoluteSrcRoot(
25476
+ fileName: configService.relativeOutputPath(
25365
25477
  isRaw ? wxsPath : removeExtension3(wxsPath)
25366
25478
  ),
25367
25479
  source: code
@@ -25376,7 +25488,7 @@ async function handleWxsDeps(state, deps, absPath) {
25376
25488
  if (!jsExtensions.includes(dep.attrs.lang) && !arr) {
25377
25489
  return;
25378
25490
  }
25379
- const wxsPath = path30.resolve(path30.dirname(absPath), dep.value);
25491
+ const wxsPath = path31.resolve(path31.dirname(absPath), dep.value);
25380
25492
  await transformWxsFile.call(this, state, wxsPath);
25381
25493
  })
25382
25494
  );
@@ -25580,17 +25692,17 @@ function createMergeFactories(options) {
25580
25692
  };
25581
25693
  if (currentOptions.isDev) {
25582
25694
  const watchInclude = [
25583
- path31.join(currentOptions.cwd, currentOptions.srcRoot, "**")
25695
+ path32.join(currentOptions.cwd, currentOptions.srcRoot, "**")
25584
25696
  ];
25585
25697
  const pluginRootConfig = currentOptions.config.weapp?.pluginRoot;
25586
25698
  if (pluginRootConfig) {
25587
- const absolutePluginRoot = path31.resolve(currentOptions.cwd, pluginRootConfig);
25588
- const relativeToSrc = path31.relative(
25589
- path31.resolve(currentOptions.cwd, currentOptions.srcRoot),
25699
+ const absolutePluginRoot = path32.resolve(currentOptions.cwd, pluginRootConfig);
25700
+ const relativeToSrc = path32.relative(
25701
+ path32.resolve(currentOptions.cwd, currentOptions.srcRoot),
25590
25702
  absolutePluginRoot
25591
25703
  );
25592
- const pluginPatternBase = relativeToSrc.startsWith("..") ? absolutePluginRoot : path31.join(currentOptions.cwd, currentOptions.srcRoot, relativeToSrc);
25593
- watchInclude.push(path31.join(pluginPatternBase, "**"));
25704
+ const pluginPatternBase = relativeToSrc.startsWith("..") ? absolutePluginRoot : path32.join(currentOptions.cwd, currentOptions.srcRoot, relativeToSrc);
25705
+ watchInclude.push(path32.join(pluginPatternBase, "**"));
25594
25706
  }
25595
25707
  const inline = defu4(
25596
25708
  currentOptions.config,
@@ -25603,7 +25715,7 @@ function createMergeFactories(options) {
25603
25715
  watch: {
25604
25716
  exclude: [
25605
25717
  ...defaultExcluded,
25606
- currentOptions.mpDistRoot ? path31.join(currentOptions.cwd, currentOptions.mpDistRoot, "**") : path31.join(currentOptions.cwd, "dist", "**")
25718
+ currentOptions.mpDistRoot ? path32.join(currentOptions.cwd, currentOptions.mpDistRoot, "**") : path32.join(currentOptions.cwd, "dist", "**")
25607
25719
  ],
25608
25720
  include: watchInclude
25609
25721
  },
@@ -25733,6 +25845,62 @@ function createConfigService(ctx) {
25733
25845
  const builtinAliases = resolveBuiltinPackageAliases();
25734
25846
  const oxcRuntimeSupport = createOxcRuntimeSupport();
25735
25847
  const aliasManager = createAliasManager(oxcRuntimeSupport.alias, builtinAliases);
25848
+ const toPosix3 = (value) => value.replace(/\\/g, "/");
25849
+ const fromPosix = (value) => path33.sep === "/" ? value : value.split("/").join(path33.sep);
25850
+ const resolveAbsolutePluginRoot = () => {
25851
+ const pluginRootConfig = options.config.weapp?.pluginRoot;
25852
+ if (!pluginRootConfig) {
25853
+ return void 0;
25854
+ }
25855
+ return path33.resolve(options.cwd, pluginRootConfig);
25856
+ };
25857
+ const resolvePluginSourceBase = () => {
25858
+ const absolutePluginRoot = resolveAbsolutePluginRoot();
25859
+ if (!absolutePluginRoot) {
25860
+ return void 0;
25861
+ }
25862
+ return toPosix3(path33.basename(absolutePluginRoot));
25863
+ };
25864
+ const resolveAbsolutePluginOutputRoot = () => {
25865
+ const absolutePluginRoot = resolveAbsolutePluginRoot();
25866
+ if (!absolutePluginRoot) {
25867
+ return void 0;
25868
+ }
25869
+ const configured = options.projectConfig?.pluginRoot;
25870
+ if (configured) {
25871
+ return path33.resolve(options.cwd, configured);
25872
+ }
25873
+ const outDir = path33.resolve(options.cwd, options.mpDistRoot ?? "");
25874
+ const pluginBase = path33.basename(absolutePluginRoot);
25875
+ return path33.resolve(outDir, pluginBase);
25876
+ };
25877
+ const resolvePluginOutputBasePosix = () => {
25878
+ const absoluteOutputRoot = resolveAbsolutePluginOutputRoot();
25879
+ if (!absoluteOutputRoot) {
25880
+ return void 0;
25881
+ }
25882
+ const outDir = path33.resolve(options.cwd, options.mpDistRoot ?? "");
25883
+ const relative3 = path33.relative(outDir, absoluteOutputRoot);
25884
+ const normalized = toPosix3(relative3);
25885
+ if (!normalized || normalized === ".") {
25886
+ return resolvePluginSourceBase();
25887
+ }
25888
+ return normalized;
25889
+ };
25890
+ const remapPluginRelativePath = (relativePath) => {
25891
+ const pluginBase = resolvePluginSourceBase();
25892
+ if (!pluginBase) {
25893
+ return relativePath;
25894
+ }
25895
+ const normalizedRelative = toPosix3(relativePath);
25896
+ if (normalizedRelative === pluginBase || normalizedRelative.startsWith(`${pluginBase}/`)) {
25897
+ const pluginRelative = normalizedRelative === pluginBase ? "" : normalizedRelative.slice(pluginBase.length + 1);
25898
+ const outputBase = resolvePluginOutputBasePosix() ?? pluginBase;
25899
+ const mapped = pluginRelative ? `${outputBase}/${pluginRelative}` : outputBase;
25900
+ return fromPosix(mapped);
25901
+ }
25902
+ return relativePath;
25903
+ };
25736
25904
  function setOptions(value) {
25737
25905
  options = value;
25738
25906
  configState.options = value;
@@ -25848,7 +26016,7 @@ function createConfigService(ctx) {
25848
26016
  return options.mpDistRoot;
25849
26017
  },
25850
26018
  get outDir() {
25851
- return path32.resolve(options.cwd, options.mpDistRoot ?? "");
26019
+ return path33.resolve(options.cwd, options.mpDistRoot ?? "");
25852
26020
  },
25853
26021
  get currentSubPackageRoot() {
25854
26022
  return options.currentSubPackageRoot;
@@ -25872,12 +26040,13 @@ function createConfigService(ctx) {
25872
26040
  return options.config.weapp?.pluginRoot;
25873
26041
  },
25874
26042
  get absolutePluginRoot() {
25875
- if (options.config.weapp?.pluginRoot) {
25876
- return path32.resolve(options.cwd, options.config.weapp.pluginRoot);
25877
- }
26043
+ return resolveAbsolutePluginRoot();
26044
+ },
26045
+ get absolutePluginOutputRoot() {
26046
+ return resolveAbsolutePluginOutputRoot();
25878
26047
  },
25879
26048
  get absoluteSrcRoot() {
25880
- return path32.resolve(options.cwd, options.srcRoot);
26049
+ return path33.resolve(options.cwd, options.srcRoot);
25881
26050
  },
25882
26051
  get mode() {
25883
26052
  return options.mode;
@@ -25895,28 +26064,34 @@ function createConfigService(ctx) {
25895
26064
  return options.weappWeb;
25896
26065
  },
25897
26066
  relativeCwd(p) {
25898
- return path32.relative(options.cwd, p);
26067
+ return path33.relative(options.cwd, p);
25899
26068
  },
25900
26069
  relativeSrcRoot(p) {
25901
26070
  return options.relativeSrcRoot(p);
25902
26071
  },
25903
26072
  relativeAbsoluteSrcRoot(p) {
25904
- const absoluteSrcRoot = path32.resolve(options.cwd, options.srcRoot);
25905
- const pluginRootConfig = options.config.weapp?.pluginRoot;
25906
- if (pluginRootConfig) {
25907
- const absolutePluginRoot = path32.resolve(options.cwd, pluginRootConfig);
25908
- const relativeToPlugin = path32.relative(absolutePluginRoot, p);
26073
+ const absoluteSrcRoot = path33.resolve(options.cwd, options.srcRoot);
26074
+ const absolutePluginRoot = resolveAbsolutePluginRoot();
26075
+ if (absolutePluginRoot) {
26076
+ const relativeToPlugin = path33.relative(absolutePluginRoot, p);
25909
26077
  if (!relativeToPlugin.startsWith("..")) {
25910
- const pluginBase = path32.basename(absolutePluginRoot);
25911
- return relativeToPlugin ? path32.join(pluginBase, relativeToPlugin) : pluginBase;
26078
+ const pluginBase = path33.basename(absolutePluginRoot);
26079
+ return relativeToPlugin ? path33.join(pluginBase, relativeToPlugin) : pluginBase;
25912
26080
  }
25913
26081
  }
25914
- const relativeFromSrc = path32.relative(absoluteSrcRoot, p);
26082
+ const relativeFromSrc = path33.relative(absoluteSrcRoot, p);
25915
26083
  if (!relativeFromSrc.startsWith("..")) {
25916
26084
  return relativeFromSrc;
25917
26085
  }
25918
- const relativeFromCwd = path32.relative(options.cwd, p);
26086
+ const relativeFromCwd = path33.relative(options.cwd, p);
25919
26087
  return relativeFromCwd;
26088
+ },
26089
+ relativeOutputPath(p) {
26090
+ const relative3 = this.relativeAbsoluteSrcRoot(p);
26091
+ if (!relative3) {
26092
+ return relative3;
26093
+ }
26094
+ return remapPluginRelativePath(relative3);
25920
26095
  }
25921
26096
  };
25922
26097
  }
@@ -26034,7 +26209,7 @@ init_esm_shims();
26034
26209
  import { isBuiltin } from "module";
26035
26210
  import { defu as defu6, isObject as isObject9, objectHash } from "@weapp-core/shared";
26036
26211
  import fs21 from "fs-extra";
26037
- import path33 from "pathe";
26212
+ import path34 from "pathe";
26038
26213
  import { build as tsdownBuild } from "tsdown";
26039
26214
  function createNpmService(ctx) {
26040
26215
  const oxcRuntimeSupport = createOxcRuntimeSupport();
@@ -26043,7 +26218,7 @@ function createNpmService(ctx) {
26043
26218
  if (!ctx.configService) {
26044
26219
  throw new Error("configService must be initialized before generating npm cache path");
26045
26220
  }
26046
- return path33.resolve(ctx.configService.cwd, `node_modules/weapp-vite/.cache/${key.replaceAll("/", "-")}.json`);
26221
+ return path34.resolve(ctx.configService.cwd, `node_modules/weapp-vite/.cache/${key.replaceAll("/", "-")}.json`);
26047
26222
  }
26048
26223
  function dependenciesCacheHash() {
26049
26224
  if (!ctx.configService) {
@@ -26147,14 +26322,14 @@ function createNpmService(ctx) {
26147
26322
  const { packageJson: targetJson, rootPath } = packageInfo;
26148
26323
  const dependencies = targetJson.dependencies ?? {};
26149
26324
  const keys = Object.keys(dependencies);
26150
- const destOutDir = path33.resolve(outDir, dep);
26325
+ const destOutDir = path34.resolve(outDir, dep);
26151
26326
  if (await shouldSkipBuild(destOutDir, isDependenciesCacheOutdate)) {
26152
26327
  logger_default.info(`[npm] \u4F9D\u8D56 \`${dep}\` \u672A\u53D1\u751F\u53D8\u5316\uFF0C\u8DF3\u8FC7\u5904\u7406!`);
26153
26328
  return;
26154
26329
  }
26155
26330
  if (isMiniprogramPackage(targetJson)) {
26156
26331
  await copyBuild({
26157
- from: path33.resolve(
26332
+ from: path34.resolve(
26158
26333
  rootPath,
26159
26334
  targetJson.miniprogram
26160
26335
  ),
@@ -26226,10 +26401,10 @@ function createNpmService(ctx) {
26226
26401
  debug?.("buildNpm start");
26227
26402
  const packNpmRelationList = getPackNpmRelationList();
26228
26403
  const [mainRelation, ...subRelations] = packNpmRelationList;
26229
- const packageJsonPath = path33.resolve(ctx.configService.cwd, mainRelation.packageJsonPath);
26404
+ const packageJsonPath = path34.resolve(ctx.configService.cwd, mainRelation.packageJsonPath);
26230
26405
  if (await fs21.exists(packageJsonPath)) {
26231
26406
  const pkgJson = await fs21.readJson(packageJsonPath);
26232
- const outDir = path33.resolve(ctx.configService.cwd, mainRelation.miniprogramNpmDistDir, "miniprogram_npm");
26407
+ const outDir = path34.resolve(ctx.configService.cwd, mainRelation.miniprogramNpmDistDir, "miniprogram_npm");
26233
26408
  if (pkgJson.dependencies) {
26234
26409
  const dependencies = Object.keys(pkgJson.dependencies);
26235
26410
  if (dependencies.length > 0) {
@@ -26248,7 +26423,7 @@ function createNpmService(ctx) {
26248
26423
  const targetDirs = [
26249
26424
  ...subRelations.map((x) => {
26250
26425
  return {
26251
- npmDistDir: path33.resolve(ctx.configService.cwd, x.miniprogramNpmDistDir, "miniprogram_npm")
26426
+ npmDistDir: path34.resolve(ctx.configService.cwd, x.miniprogramNpmDistDir, "miniprogram_npm")
26252
26427
  };
26253
26428
  }),
26254
26429
  ...[...ctx.scanService.independentSubPackageMap.values()].map((x) => {
@@ -26256,7 +26431,7 @@ function createNpmService(ctx) {
26256
26431
  return {
26257
26432
  root: x.subPackage.root,
26258
26433
  dependencies: dependencies2,
26259
- npmDistDir: path33.resolve(ctx.configService.cwd, mainRelation.miniprogramNpmDistDir, x.subPackage.root, "miniprogram_npm")
26434
+ npmDistDir: path34.resolve(ctx.configService.cwd, mainRelation.miniprogramNpmDistDir, x.subPackage.root, "miniprogram_npm")
26260
26435
  };
26261
26436
  })
26262
26437
  ];
@@ -26268,7 +26443,7 @@ function createNpmService(ctx) {
26268
26443
  overwrite: true,
26269
26444
  filter: (src) => {
26270
26445
  if (Array.isArray(x.dependencies)) {
26271
- const relPath = path33.relative(outDir, src);
26446
+ const relPath = path34.relative(outDir, src);
26272
26447
  if (relPath === "") {
26273
26448
  return true;
26274
26449
  }
@@ -26284,7 +26459,7 @@ function createNpmService(ctx) {
26284
26459
  overwrite: true,
26285
26460
  filter: (src) => {
26286
26461
  if (Array.isArray(x.dependencies)) {
26287
- const relPath = path33.relative(outDir, src);
26462
+ const relPath = path34.relative(outDir, src);
26288
26463
  if (relPath === "") {
26289
26464
  return true;
26290
26465
  }
@@ -26329,14 +26504,14 @@ function createNpmServicePlugin(ctx) {
26329
26504
  init_esm_shims();
26330
26505
  import process9 from "process";
26331
26506
 
26332
- // ../../node_modules/.pnpm/p-queue@9.0.0/node_modules/p-queue/dist/index.js
26507
+ // ../../node_modules/.pnpm/p-queue@9.0.1/node_modules/p-queue/dist/index.js
26333
26508
  init_esm_shims();
26334
26509
 
26335
26510
  // ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.mjs
26336
26511
  init_esm_shims();
26337
26512
  var import_index2 = __toESM(require_eventemitter3(), 1);
26338
26513
 
26339
- // ../../node_modules/.pnpm/p-timeout@7.0.0/node_modules/p-timeout/index.js
26514
+ // ../../node_modules/.pnpm/p-timeout@7.0.1/node_modules/p-timeout/index.js
26340
26515
  init_esm_shims();
26341
26516
  var TimeoutError = class _TimeoutError extends Error {
26342
26517
  name = "TimeoutError";
@@ -26375,7 +26550,7 @@ function pTimeout(promise, options) {
26375
26550
  return;
26376
26551
  }
26377
26552
  const timeoutError = new TimeoutError();
26378
- timer = customTimers.setTimeout(() => {
26553
+ timer = customTimers.setTimeout.call(void 0, () => {
26379
26554
  if (fallback) {
26380
26555
  try {
26381
26556
  resolve8(fallback());
@@ -26404,16 +26579,16 @@ function pTimeout(promise, options) {
26404
26579
  }
26405
26580
  });
26406
26581
  cancelablePromise.clear = () => {
26407
- customTimers.clearTimeout(timer);
26582
+ customTimers.clearTimeout.call(void 0, timer);
26408
26583
  timer = void 0;
26409
26584
  };
26410
26585
  return cancelablePromise;
26411
26586
  }
26412
26587
 
26413
- // ../../node_modules/.pnpm/p-queue@9.0.0/node_modules/p-queue/dist/priority-queue.js
26588
+ // ../../node_modules/.pnpm/p-queue@9.0.1/node_modules/p-queue/dist/priority-queue.js
26414
26589
  init_esm_shims();
26415
26590
 
26416
- // ../../node_modules/.pnpm/p-queue@9.0.0/node_modules/p-queue/dist/lower-bound.js
26591
+ // ../../node_modules/.pnpm/p-queue@9.0.1/node_modules/p-queue/dist/lower-bound.js
26417
26592
  init_esm_shims();
26418
26593
  function lowerBound(array, value, comparator) {
26419
26594
  let first = 0;
@@ -26431,7 +26606,7 @@ function lowerBound(array, value, comparator) {
26431
26606
  return first;
26432
26607
  }
26433
26608
 
26434
- // ../../node_modules/.pnpm/p-queue@9.0.0/node_modules/p-queue/dist/priority-queue.js
26609
+ // ../../node_modules/.pnpm/p-queue@9.0.1/node_modules/p-queue/dist/priority-queue.js
26435
26610
  var PriorityQueue = class {
26436
26611
  #queue = [];
26437
26612
  enqueue(run, options) {
@@ -26468,7 +26643,7 @@ var PriorityQueue = class {
26468
26643
  }
26469
26644
  };
26470
26645
 
26471
- // ../../node_modules/.pnpm/p-queue@9.0.0/node_modules/p-queue/dist/index.js
26646
+ // ../../node_modules/.pnpm/p-queue@9.0.1/node_modules/p-queue/dist/index.js
26472
26647
  var PQueue = class extends import_index2.default {
26473
26648
  #carryoverIntervalCount;
26474
26649
  #isIntervalIgnored;
@@ -26661,13 +26836,6 @@ var PQueue = class extends import_index2.default {
26661
26836
  this.#concurrency = newConcurrency;
26662
26837
  this.#processQueue();
26663
26838
  }
26664
- async #throwOnAbort(signal) {
26665
- return new Promise((_resolve3, reject) => {
26666
- signal.addEventListener("abort", () => {
26667
- reject(signal.reason);
26668
- }, { once: true });
26669
- });
26670
- }
26671
26839
  /**
26672
26840
  Updates the priority of a promise function by its id, affecting its execution order. Requires a defined concurrency limit to take effect.
26673
26841
 
@@ -26727,6 +26895,7 @@ var PQueue = class extends import_index2.default {
26727
26895
  startTime: Date.now(),
26728
26896
  timeout: options.timeout
26729
26897
  });
26898
+ let eventListener;
26730
26899
  try {
26731
26900
  try {
26732
26901
  options.signal?.throwIfAborted();
@@ -26745,7 +26914,13 @@ var PQueue = class extends import_index2.default {
26745
26914
  });
26746
26915
  }
26747
26916
  if (options.signal) {
26748
- operation = Promise.race([operation, this.#throwOnAbort(options.signal)]);
26917
+ const { signal } = options;
26918
+ operation = Promise.race([operation, new Promise((_resolve3, reject2) => {
26919
+ eventListener = () => {
26920
+ reject2(signal.reason);
26921
+ };
26922
+ signal.addEventListener("abort", eventListener, { once: true });
26923
+ })]);
26749
26924
  }
26750
26925
  const result = await operation;
26751
26926
  resolve8(result);
@@ -26754,6 +26929,9 @@ var PQueue = class extends import_index2.default {
26754
26929
  reject(error);
26755
26930
  this.emit("error", error);
26756
26931
  } finally {
26932
+ if (eventListener) {
26933
+ options.signal?.removeEventListener("abort", eventListener);
26934
+ }
26757
26935
  this.#runningTasks.delete(taskSymbol);
26758
26936
  queueMicrotask(() => {
26759
26937
  this.#next();
@@ -27250,7 +27428,7 @@ function createRuntimeState() {
27250
27428
  init_esm_shims();
27251
27429
  import { isObject as isObject10, removeExtensionDeep as removeExtensionDeep6 } from "@weapp-core/shared";
27252
27430
  import fs23 from "fs-extra";
27253
- import path34 from "pathe";
27431
+ import path35 from "pathe";
27254
27432
  var SUPPORTED_SHARED_STYLE_EXTENSIONS = [
27255
27433
  ".wxss",
27256
27434
  ".css",
@@ -27269,8 +27447,8 @@ function toPosix2(value) {
27269
27447
  return value.replace(BACKSLASH_RE, "/");
27270
27448
  }
27271
27449
  function isPathInside(parent, target) {
27272
- const relative3 = path34.relative(parent, target);
27273
- return relative3 === "" || !relative3.startsWith("..") && !path34.isAbsolute(relative3);
27450
+ const relative3 = path35.relative(parent, target);
27451
+ return relative3 === "" || !relative3.startsWith("..") && !path35.isAbsolute(relative3);
27274
27452
  }
27275
27453
  function resolveSubPackageEntries(subPackage) {
27276
27454
  const entries = [];
@@ -27294,17 +27472,17 @@ function resolveStyleEntryAbsolutePath(source, subPackageRoot, configService) {
27294
27472
  return void 0;
27295
27473
  }
27296
27474
  const srcRoot = service.absoluteSrcRoot;
27297
- const absoluteSubRoot = path34.resolve(srcRoot, subPackageRoot);
27475
+ const absoluteSubRoot = path35.resolve(srcRoot, subPackageRoot);
27298
27476
  const normalizedEntry = toPosix2(trimmed);
27299
27477
  const normalizedRoot = toPosix2(subPackageRoot);
27300
27478
  const candidates = [];
27301
- if (path34.isAbsolute(trimmed)) {
27479
+ if (path35.isAbsolute(trimmed)) {
27302
27480
  candidates.push(trimmed);
27303
27481
  } else if (normalizedEntry === normalizedRoot || normalizedEntry.startsWith(`${normalizedRoot}/`)) {
27304
- candidates.push(path34.resolve(srcRoot, trimmed));
27482
+ candidates.push(path35.resolve(srcRoot, trimmed));
27305
27483
  } else {
27306
- candidates.push(path34.resolve(absoluteSubRoot, trimmed));
27307
- candidates.push(path34.resolve(srcRoot, trimmed));
27484
+ candidates.push(path35.resolve(absoluteSubRoot, trimmed));
27485
+ candidates.push(path35.resolve(srcRoot, trimmed));
27308
27486
  }
27309
27487
  for (const candidate of candidates) {
27310
27488
  if (isPathInside(srcRoot, candidate)) {
@@ -27412,7 +27590,7 @@ function inferScopeFromRelativePath(relativePath) {
27412
27590
  if (cleaned.includes("/")) {
27413
27591
  return void 0;
27414
27592
  }
27415
- const base = path34.posix.basename(cleaned, path34.posix.extname(cleaned));
27593
+ const base = path35.posix.basename(cleaned, path35.posix.extname(cleaned));
27416
27594
  if (base === "pages") {
27417
27595
  return "pages";
27418
27596
  }
@@ -27475,18 +27653,18 @@ function addStyleEntry(descriptor, absolutePath, posixOutput, root, normalizedRo
27475
27653
  source: descriptor.source,
27476
27654
  absolutePath,
27477
27655
  outputRelativePath: posixOutput,
27478
- inputExtension: path34.extname(absolutePath).toLowerCase(),
27656
+ inputExtension: path35.extname(absolutePath).toLowerCase(),
27479
27657
  scope: descriptor.scope,
27480
27658
  include,
27481
27659
  exclude
27482
27660
  });
27483
27661
  }
27484
27662
  function appendDefaultScopedStyleEntries(root, normalizedRoot, service, dedupe, normalized) {
27485
- const absoluteSubRoot = path34.resolve(service.absoluteSrcRoot, root);
27663
+ const absoluteSubRoot = path35.resolve(service.absoluteSrcRoot, root);
27486
27664
  for (const { base, scope } of DEFAULT_SCOPED_FILES) {
27487
27665
  for (const ext2 of DEFAULT_SCOPED_EXTENSIONS) {
27488
27666
  const filename = `${base}${ext2}`;
27489
- const absolutePath = path34.resolve(absoluteSubRoot, filename);
27667
+ const absolutePath = path35.resolve(absoluteSubRoot, filename);
27490
27668
  if (!fs23.existsSync(absolutePath)) {
27491
27669
  continue;
27492
27670
  }
@@ -27498,7 +27676,7 @@ function appendDefaultScopedStyleEntries(root, normalizedRoot, service, dedupe,
27498
27676
  explicitScope: true
27499
27677
  };
27500
27678
  const outputAbsolutePath = changeFileExtension(absolutePath, service.outputExtensions.wxss);
27501
- const outputRelativePath = service.relativeAbsoluteSrcRoot(outputAbsolutePath);
27679
+ const outputRelativePath = service.relativeOutputPath(outputAbsolutePath);
27502
27680
  if (!outputRelativePath) {
27503
27681
  continue;
27504
27682
  }
@@ -27536,13 +27714,13 @@ function normalizeSubPackageStyleEntries(styles, subPackage, configService) {
27536
27714
  logger_default.warn(`[subpackages] \u5206\u5305 ${root} \u6837\u5F0F\u5165\u53E3 \`${descriptor.source}\` \u5BF9\u5E94\u6587\u4EF6\u4E0D\u5B58\u5728\uFF0C\u5DF2\u5FFD\u7565\u3002`);
27537
27715
  continue;
27538
27716
  }
27539
- const ext2 = path34.extname(absolutePath).toLowerCase();
27717
+ const ext2 = path35.extname(absolutePath).toLowerCase();
27540
27718
  if (!SUPPORTED_SHARED_STYLE_EXTS.has(ext2)) {
27541
27719
  logger_default.warn(`[subpackages] \u5206\u5305 ${root} \u6837\u5F0F\u5165\u53E3 \`${descriptor.source}\` \u5F53\u524D\u4EC5\u652F\u6301\u4EE5\u4E0B\u683C\u5F0F\uFF1A${SUPPORTED_SHARED_STYLE_EXTENSIONS.join(", ")}\uFF0C\u5DF2\u5FFD\u7565\u3002`);
27542
27720
  continue;
27543
27721
  }
27544
27722
  const outputAbsolutePath = changeFileExtension(absolutePath, service.outputExtensions.wxss);
27545
- const outputRelativePath = service.relativeAbsoluteSrcRoot(outputAbsolutePath);
27723
+ const outputRelativePath = service.relativeOutputPath(outputAbsolutePath);
27546
27724
  if (!outputRelativePath) {
27547
27725
  logger_default.warn(`[subpackages] \u5206\u5305 ${root} \u6837\u5F0F\u5165\u53E3 \`${descriptor.source}\` \u4E0D\u5728\u9879\u76EE\u6E90\u7801\u76EE\u5F55\u5185\uFF0C\u5DF2\u5FFD\u7565\u3002`);
27548
27726
  continue;
@@ -27570,11 +27748,11 @@ function createScanService(ctx) {
27570
27748
  return scanState.appEntry;
27571
27749
  }
27572
27750
  const appDirname = ctx.configService.absoluteSrcRoot;
27573
- const appBasename = path34.resolve(appDirname, "app");
27751
+ const appBasename = path35.resolve(appDirname, "app");
27574
27752
  const { path: appConfigFile } = await findJsonEntry(appBasename);
27575
27753
  const { path: appEntryPath } = await findJsEntry(appBasename);
27576
27754
  if (ctx.configService.absolutePluginRoot) {
27577
- const pluginBasename = path34.resolve(ctx.configService.absolutePluginRoot, "plugin");
27755
+ const pluginBasename = path35.resolve(ctx.configService.absolutePluginRoot, "plugin");
27578
27756
  const { path: pluginConfigFile } = await findJsonEntry(pluginBasename);
27579
27757
  if (pluginConfigFile) {
27580
27758
  const pluginConfig = await ctx.jsonService.read(pluginConfigFile);
@@ -27597,14 +27775,14 @@ function createScanService(ctx) {
27597
27775
  scanState.appEntry = resolvedAppEntry;
27598
27776
  const { sitemapLocation = "sitemap.json", themeLocation = "theme.json" } = config;
27599
27777
  if (sitemapLocation) {
27600
- const { path: sitemapJsonPath } = await findJsonEntry(path34.resolve(appDirname, sitemapLocation));
27778
+ const { path: sitemapJsonPath } = await findJsonEntry(path35.resolve(appDirname, sitemapLocation));
27601
27779
  if (sitemapJsonPath) {
27602
27780
  resolvedAppEntry.sitemapJsonPath = sitemapJsonPath;
27603
27781
  resolvedAppEntry.sitemapJson = await ctx.jsonService.read(sitemapJsonPath);
27604
27782
  }
27605
27783
  }
27606
27784
  if (themeLocation) {
27607
- const { path: themeJsonPath } = await findJsonEntry(path34.resolve(appDirname, themeLocation));
27785
+ const { path: themeJsonPath } = await findJsonEntry(path35.resolve(appDirname, themeLocation));
27608
27786
  if (themeJsonPath) {
27609
27787
  resolvedAppEntry.themeJsonPath = themeJsonPath;
27610
27788
  resolvedAppEntry.themeJson = await ctx.jsonService.read(themeJsonPath);
@@ -27880,7 +28058,7 @@ function createWebServicePlugin(ctx) {
27880
28058
  init_esm_shims();
27881
28059
  import { removeExtensionDeep as removeExtensionDeep7 } from "@weapp-core/shared";
27882
28060
  import fs24 from "fs-extra";
27883
- import path35 from "pathe";
28061
+ import path36 from "pathe";
27884
28062
 
27885
28063
  // src/wxml/index.ts
27886
28064
  init_esm_shims();
@@ -30590,7 +30768,7 @@ function createWxmlService(ctx) {
30590
30768
  throw new Error("configService must be initialized before scanning wxml");
30591
30769
  }
30592
30770
  if (await fs24.exists(filepath)) {
30593
- const dirname5 = path35.dirname(filepath);
30771
+ const dirname5 = path36.dirname(filepath);
30594
30772
  const wxml = await fs24.readFile(filepath, "utf8");
30595
30773
  const shouldRescan = await cache2.isInvalidate(filepath, { content: wxml });
30596
30774
  if (!shouldRescan) {
@@ -30607,9 +30785,9 @@ function createWxmlService(ctx) {
30607
30785
  filepath,
30608
30786
  res.deps.filter((x) => isImportTag(x.tagName) && isTemplate(x.value)).map((x) => {
30609
30787
  if (x.value.startsWith("/")) {
30610
- return path35.resolve(ctx.configService.absoluteSrcRoot, x.value.slice(1));
30788
+ return path36.resolve(ctx.configService.absoluteSrcRoot, x.value.slice(1));
30611
30789
  } else {
30612
- return path35.resolve(dirname5, x.value);
30790
+ return path36.resolve(dirname5, x.value);
30613
30791
  }
30614
30792
  })
30615
30793
  );