@rsbuild/core 2.0.0-beta.1 → 2.0.0-beta.11

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 (132) hide show
  1. package/compiled/chokidar/index.d.ts +197 -29
  2. package/compiled/chokidar/package.json +1 -1
  3. package/compiled/connect-next/index.d.ts +56 -0
  4. package/compiled/connect-next/license +26 -0
  5. package/compiled/connect-next/package.json +1 -0
  6. package/compiled/cors/index.d.ts +56 -0
  7. package/compiled/cors/license +22 -0
  8. package/compiled/cors/package.json +1 -0
  9. package/compiled/css-loader/index.js +2 -2
  10. package/compiled/css-loader/package.json +1 -1
  11. package/compiled/html-rspack-plugin/index.js +29 -74
  12. package/compiled/html-rspack-plugin/package.json +1 -1
  13. package/compiled/jiti/LICENSE +21 -0
  14. package/compiled/jiti/README.md +243 -0
  15. package/compiled/jiti/dist/babel.cjs +46699 -0
  16. package/compiled/jiti/dist/jiti.cjs +4842 -0
  17. package/compiled/jiti/lib/jiti-cli.mjs +19 -0
  18. package/compiled/jiti/lib/jiti-hooks.mjs +89 -0
  19. package/compiled/jiti/lib/jiti-native.mjs +76 -0
  20. package/compiled/jiti/lib/jiti-register.d.mts +1 -0
  21. package/compiled/jiti/lib/jiti-register.mjs +2 -0
  22. package/compiled/jiti/lib/jiti.cjs +24 -0
  23. package/compiled/jiti/lib/jiti.d.cts +8 -0
  24. package/compiled/jiti/lib/jiti.d.mts +8 -0
  25. package/compiled/jiti/lib/jiti.mjs +23 -0
  26. package/compiled/jiti/lib/types.d.ts +363 -0
  27. package/compiled/jiti/package.json +133 -0
  28. package/compiled/postcss/index.js +1 -1
  29. package/compiled/postcss/lib/at-rule.d.ts +1 -1
  30. package/compiled/postcss/lib/comment.d.ts +1 -1
  31. package/compiled/postcss/lib/container.d.ts +1 -1
  32. package/compiled/postcss/lib/css-syntax-error.d.ts +1 -1
  33. package/compiled/postcss/lib/declaration.d.ts +1 -1
  34. package/compiled/postcss/lib/document.d.ts +1 -1
  35. package/compiled/postcss/lib/input.d.ts +1 -1
  36. package/compiled/postcss/lib/lazy-result.d.ts +1 -1
  37. package/compiled/postcss/lib/no-work-result.d.ts +1 -1
  38. package/compiled/postcss/lib/node.d.ts +1 -1
  39. package/compiled/postcss/lib/previous-map.d.ts +1 -1
  40. package/compiled/postcss/lib/processor.d.ts +1 -1
  41. package/compiled/postcss/lib/result.d.ts +1 -1
  42. package/compiled/postcss/lib/root.d.ts +1 -1
  43. package/compiled/postcss/lib/rule.d.ts +1 -1
  44. package/compiled/postcss/lib/stringifier.d.ts +1 -1
  45. package/compiled/postcss/lib/warning.d.ts +1 -1
  46. package/compiled/postcss/package.json +1 -1
  47. package/compiled/postcss-loader/index.js +10 -9
  48. package/compiled/postcss-loader/package.json +1 -1
  49. package/compiled/rslog/index.d.ts +34 -3
  50. package/compiled/rslog/package.json +1 -1
  51. package/compiled/rspack-chain/package.json +1 -1
  52. package/compiled/rspack-chain/types/index.d.ts +0 -5
  53. package/compiled/rspack-manifest-plugin/index.d.ts +48 -0
  54. package/compiled/rspack-manifest-plugin/license +21 -0
  55. package/compiled/rspack-manifest-plugin/package.json +1 -0
  56. package/compiled/style-loader/index.js +37 -94
  57. package/compiled/style-loader/package.json +1 -1
  58. package/dist/{rslib-runtime.js → 1~rslib-runtime.js} +4 -4
  59. package/dist/{131.js → 552.js} +1753 -1573
  60. package/dist/chokidar.js +60 -57
  61. package/dist/client/hmr.js +3 -3
  62. package/dist/client/overlay.js +2 -2
  63. package/dist/connect-next.js +264 -0
  64. package/dist/{connect.js.LICENSE.txt → connect-next.js.LICENSE.txt} +3 -13
  65. package/dist/cors.js +3 -3
  66. package/dist/debug.js +503 -0
  67. package/dist/http-proxy-middleware.js +2947 -0
  68. package/dist/http-proxy-middleware.js.LICENSE.txt +69 -0
  69. package/dist/index.js +1 -1
  70. package/dist/launch-editor-middleware.js +81 -20
  71. package/dist/manifest-plugin.js +12 -19
  72. package/dist/memfs.js +223 -781
  73. package/dist/open.js +32 -28
  74. package/dist/range-parser.js +3 -3
  75. package/dist/remapping.js +2 -2
  76. package/dist/sirv.js +18 -18
  77. package/dist/tinyglobby.js +115 -70
  78. package/dist/transformLoader.mjs +38 -1
  79. package/dist/transformRawLoader.mjs +1 -1
  80. package/dist/ws.js +1513 -0
  81. package/dist-types/createContext.d.ts +3 -2
  82. package/dist-types/helpers/format.d.ts +2 -1
  83. package/dist-types/helpers/fs.d.ts +2 -1
  84. package/dist-types/helpers/index.d.ts +1 -1
  85. package/dist-types/helpers/stats.d.ts +4 -3
  86. package/dist-types/helpers/vendors.d.ts +0 -2
  87. package/dist-types/hooks.d.ts +3 -3
  88. package/dist-types/index.d.ts +4 -3
  89. package/dist-types/initPlugins.d.ts +2 -1
  90. package/dist-types/logger.d.ts +9 -3
  91. package/dist-types/pluginManager.d.ts +2 -1
  92. package/dist-types/restart.d.ts +4 -2
  93. package/dist-types/server/assets-middleware/index.d.ts +3 -2
  94. package/dist-types/server/assets-middleware/setupWriteToDisk.d.ts +2 -1
  95. package/dist-types/server/cliShortcuts.d.ts +4 -1
  96. package/dist-types/server/devMiddlewares.d.ts +4 -6
  97. package/dist-types/server/devServer.d.ts +8 -42
  98. package/dist-types/server/helper.d.ts +50 -16
  99. package/dist-types/server/historyApiFallback.d.ts +2 -1
  100. package/dist-types/server/middlewares.d.ts +5 -3
  101. package/dist-types/server/open.d.ts +4 -2
  102. package/dist-types/server/previewServer.d.ts +4 -0
  103. package/dist-types/server/proxy.d.ts +3 -2
  104. package/dist-types/server/runner/asModule.d.ts +1 -1
  105. package/dist-types/server/serverSetup.d.ts +2 -0
  106. package/dist-types/server/socketServer.d.ts +4 -1
  107. package/dist-types/server/watchFiles.d.ts +1 -1
  108. package/dist-types/types/config.d.ts +110 -17
  109. package/dist-types/types/context.d.ts +3 -0
  110. package/dist-types/types/hooks.d.ts +17 -15
  111. package/dist-types/types/plugin.d.ts +14 -11
  112. package/dist-types/types/rsbuild.d.ts +11 -4
  113. package/dist-types/types/thirdParty.d.ts +15 -6
  114. package/package.json +25 -28
  115. package/types.d.ts +1 -1
  116. package/compiled/chokidar/handler.d.ts +0 -90
  117. package/compiled/http-proxy-middleware/index.js +0 -6132
  118. package/compiled/ws/index.d.ts +0 -437
  119. package/compiled/ws/index.js +0 -3166
  120. package/compiled/ws/license +0 -20
  121. package/compiled/ws/package.json +0 -1
  122. package/dist/397.js +0 -11
  123. package/dist/7.js +0 -1
  124. package/dist/743.js +0 -7
  125. package/dist/88.js +0 -40
  126. package/dist/connect.js +0 -581
  127. package/dist-types/server/prodServer.d.ts +0 -24
  128. /package/compiled/html-rspack-plugin/{loader.js → htmlLoader.js} +0 -0
  129. /package/dist/{131.js.LICENSE.txt → 552.js.LICENSE.txt} +0 -0
  130. /package/dist/client/{59.js → 797.js} +0 -0
  131. /package/dist/{710.js → mrmime.js} +0 -0
  132. /package/dist/{31.js → trace-mapping.js} +0 -0
package/dist/chokidar.js CHANGED
@@ -1,9 +1,12 @@
1
- /*! For license information please see chokidar.js.LICENSE.txt */
2
- import { __webpack_require__ } from "./rslib-runtime.js";
3
- import { external_node_os_type } from "./131.js";
4
- import "./397.js";
5
- import { readdir, lstat, stat as promises_stat, realpath as promises_realpath, promises_open } from "./7.js";
6
- let external_node_path_ = __webpack_require__("node:path"), external_node_stream_ = __webpack_require__("node:stream"), EntryTypes_FILE_TYPE = 'files', EntryTypes_DIR_TYPE = 'directories', EntryTypes_FILE_DIR_TYPE = 'files_directories', defaultOptions = {
1
+ /*! LICENSE: chokidar.js.LICENSE.txt */
2
+ import { EventEmitter } from "node:events";
3
+ import { stat as external_node_fs_stat, unwatchFile, watch, watchFile } from "node:fs";
4
+ import { lstat, open as promises_open, readdir, realpath as promises_realpath, stat as promises_stat } from "node:fs/promises";
5
+ import { join, relative as external_node_path_relative, resolve as external_node_path_resolve, sep } from "node:path";
6
+ import { Readable } from "node:stream";
7
+ import { type as external_node_os_type } from "node:os";
8
+ import * as __rspack_external_node_path_c5b9b54f from "node:path";
9
+ let EntryTypes_FILE_TYPE = 'files', EntryTypes_DIR_TYPE = 'directories', EntryTypes_FILE_DIR_TYPE = 'files_directories', defaultOptions = {
7
10
  root: '.',
8
11
  fileFilter: (_entryInfo)=>!0,
9
12
  directoryFilter: (_entryInfo)=>!0,
@@ -46,7 +49,7 @@ let RECURSIVE_ERROR_CODE = 'READDIRP_RECURSIVE_ERROR', NORMAL_FLOW_ERRORS = new
46
49
  }
47
50
  return emptyFn;
48
51
  };
49
- class ReaddirpStream extends external_node_stream_.Readable {
52
+ class ReaddirpStream extends Readable {
50
53
  parents;
51
54
  reading;
52
55
  parent;
@@ -75,7 +78,7 @@ class ReaddirpStream extends external_node_stream_.Readable {
75
78
  let statMethod = opts.lstat ? lstat : promises_stat;
76
79
  wantBigintFsStats ? this._stat = (path)=>statMethod(path, {
77
80
  bigint: !0
78
- }) : this._stat = statMethod, this._maxDepth = null != opts.depth && Number.isSafeInteger(opts.depth) ? opts.depth : defaultOptions.depth, this._wantsDir = !!type && DIR_TYPES.has(type), this._wantsFile = !!type && FILE_TYPES.has(type), this._wantsEverything = 'all' === type, this._root = (0, external_node_path_.resolve)(root), this._isDirent = !opts.alwaysStat, this._statsProp = this._isDirent ? 'dirent' : 'stats', this._rdOptions = {
81
+ }) : this._stat = statMethod, this._maxDepth = null != opts.depth && Number.isSafeInteger(opts.depth) ? opts.depth : defaultOptions.depth, this._wantsDir = !!type && DIR_TYPES.has(type), this._wantsFile = !!type && FILE_TYPES.has(type), this._wantsEverything = 'all' === type, this._root = external_node_path_resolve(root), this._isDirent = !opts.alwaysStat, this._statsProp = this._isDirent ? 'dirent' : 'stats', this._rdOptions = {
79
82
  encoding: 'utf8',
80
83
  withFileTypes: this._isDirent
81
84
  }, this.parents = [
@@ -128,9 +131,9 @@ class ReaddirpStream extends external_node_stream_.Readable {
128
131
  async _formatEntry(dirent, path) {
129
132
  let entry, basename = this._isDirent ? dirent.name : dirent;
130
133
  try {
131
- let fullPath = (0, external_node_path_.resolve)((0, external_node_path_.join)(path, basename));
134
+ let fullPath = external_node_path_resolve(join(path, basename));
132
135
  (entry = {
133
- path: (0, external_node_path_.relative)(this._root, fullPath),
136
+ path: external_node_path_relative(this._root, fullPath),
134
137
  fullPath,
135
138
  basename
136
139
  })[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
@@ -155,7 +158,7 @@ class ReaddirpStream extends external_node_stream_.Readable {
155
158
  if (entryRealPathStats.isFile()) return 'file';
156
159
  if (entryRealPathStats.isDirectory()) {
157
160
  let len = entryRealPath.length;
158
- if (full.startsWith(entryRealPath) && full.substr(len, 1) === external_node_path_.sep) {
161
+ if (full.startsWith(entryRealPath) && full.substr(len, 1) === sep) {
159
162
  let recursiveError = Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
160
163
  return recursiveError.code = RECURSIVE_ERROR_CODE, this._onError(recursiveError);
161
164
  }
@@ -179,7 +182,7 @@ function readdirp(root, options = {}) {
179
182
  } else throw Error('readdirp: root argument is required. Usage: readdirp(root, options)');
180
183
  return options.root = root, new ReaddirpStream(options);
181
184
  }
182
- let external_node_fs_ = __webpack_require__("node:fs"), EMPTY_FN = ()=>{}, pl = process.platform, isWindows = 'win32' === pl, isMacos = 'darwin' === pl, isLinux = 'linux' === pl, isFreeBSD = 'freebsd' === pl, isIBMi = 'OS400' === external_node_os_type(), EVENTS_ALL = 'all', EVENTS_READY = 'ready', EVENTS_ADD = 'add', EVENTS_CHANGE = 'change', EVENTS_ADD_DIR = 'addDir', EVENTS_UNLINK = 'unlink', EVENTS_UNLINK_DIR = 'unlinkDir', EVENTS_RAW = 'raw', EVENTS_ERROR = 'error', statMethods = {
185
+ let EMPTY_FN = ()=>{}, pl = process.platform, isWindows = 'win32' === pl, isMacos = 'darwin' === pl, isLinux = 'linux' === pl, isFreeBSD = 'freebsd' === pl, isIBMi = 'OS400' === external_node_os_type(), EVENTS_ALL = 'all', EVENTS_READY = 'ready', EVENTS_ADD = 'add', EVENTS_CHANGE = 'change', EVENTS_ADD_DIR = 'addDir', EVENTS_UNLINK = 'unlink', EVENTS_UNLINK_DIR = 'unlinkDir', EVENTS_RAW = 'raw', EVENTS_ERROR = 'error', statMethods = {
183
186
  lstat: lstat,
184
187
  stat: promises_stat
185
188
  }, KEY_LISTENERS = 'listeners', KEY_ERR = 'errHandlers', KEY_RAW = 'rawEmitters', HANDLER_KEYS = [
@@ -461,12 +464,12 @@ let external_node_fs_ = __webpack_require__("node:fs"), EMPTY_FN = ()=>{}, pl =
461
464
  }, isEmptySet = (val)=>val instanceof Set ? 0 === val.size : !val, FsWatchInstances = new Map();
462
465
  function createFsWatchInstance(path, options, listener, errHandler, emitRaw) {
463
466
  try {
464
- return (0, external_node_fs_.watch)(path, {
467
+ return watch(path, {
465
468
  persistent: options.persistent
466
469
  }, (rawEvent, evPath)=>{
467
470
  listener(path), emitRaw(rawEvent, evPath, {
468
471
  watchedPath: path
469
- }), evPath && path !== evPath && fsWatchBroadcast(external_node_path_.resolve(path, evPath), KEY_LISTENERS, external_node_path_.join(path, evPath));
472
+ }), evPath && path !== evPath && fsWatchBroadcast(__rspack_external_node_path_c5b9b54f.resolve(path, evPath), KEY_LISTENERS, __rspack_external_node_path_c5b9b54f.join(path, evPath));
470
473
  });
471
474
  } catch (error) {
472
475
  errHandler(error);
@@ -486,18 +489,18 @@ class NodeFsHandler {
486
489
  this.fsw = fsW, this._boundHandleError = (error)=>fsW._handleError(error);
487
490
  }
488
491
  _watchWithNodeFs(path, listener) {
489
- let closer, opts = this.fsw.options, directory = external_node_path_.dirname(path), basename = external_node_path_.basename(path);
492
+ let closer, opts = this.fsw.options, directory = __rspack_external_node_path_c5b9b54f.dirname(path), basename = __rspack_external_node_path_c5b9b54f.basename(path);
490
493
  this.fsw._getWatchedDir(directory).add(basename);
491
- let absolutePath = external_node_path_.resolve(path), options = {
494
+ let absolutePath = __rspack_external_node_path_c5b9b54f.resolve(path), options = {
492
495
  persistent: opts.persistent
493
496
  };
494
- if (listener || (listener = EMPTY_FN), opts.usePolling) options.interval = opts.interval !== opts.binaryInterval && binaryExtensions.has(external_node_path_.extname(basename).slice(1).toLowerCase()) ? opts.binaryInterval : opts.interval, closer = ((path, fullPath, options, handlers)=>{
497
+ if (listener || (listener = EMPTY_FN), opts.usePolling) options.interval = opts.interval !== opts.binaryInterval && binaryExtensions.has(__rspack_external_node_path_c5b9b54f.extname(basename).slice(1).toLowerCase()) ? opts.binaryInterval : opts.interval, closer = ((path, fullPath, options, handlers)=>{
495
498
  let { listener, rawEmitter } = handlers, cont = FsWatchFileInstances.get(fullPath), copts = cont && cont.options;
496
- return copts && (copts.persistent < options.persistent || copts.interval > options.interval) && ((0, external_node_fs_.unwatchFile)(fullPath), cont = void 0), cont ? (addAndConvert(cont, KEY_LISTENERS, listener), addAndConvert(cont, KEY_RAW, rawEmitter)) : (cont = {
499
+ return copts && (copts.persistent < options.persistent || copts.interval > options.interval) && (unwatchFile(fullPath), cont = void 0), cont ? (addAndConvert(cont, KEY_LISTENERS, listener), addAndConvert(cont, KEY_RAW, rawEmitter)) : (cont = {
497
500
  listeners: listener,
498
501
  rawEmitters: rawEmitter,
499
502
  options,
500
- watcher: (0, external_node_fs_.watchFile)(fullPath, options, (curr, prev)=>{
503
+ watcher: watchFile(fullPath, options, (curr, prev)=>{
501
504
  foreach(cont.rawEmitters, (rawEmitter)=>{
502
505
  rawEmitter(EVENTS_CHANGE, fullPath, {
503
506
  curr,
@@ -508,7 +511,7 @@ class NodeFsHandler {
508
511
  (curr.size !== prev.size || currmtime > prev.mtimeMs || 0 === currmtime) && foreach(cont.listeners, (listener)=>listener(path, curr));
509
512
  })
510
513
  }, FsWatchFileInstances.set(fullPath, cont)), ()=>{
511
- delFromSet(cont, KEY_LISTENERS, listener), delFromSet(cont, KEY_RAW, rawEmitter), isEmptySet(cont.listeners) && (FsWatchFileInstances.delete(fullPath), (0, external_node_fs_.unwatchFile)(fullPath), cont.options = cont.watcher = void 0, Object.freeze(cont));
514
+ delFromSet(cont, KEY_LISTENERS, listener), delFromSet(cont, KEY_RAW, rawEmitter), isEmptySet(cont.listeners) && (FsWatchFileInstances.delete(fullPath), unwatchFile(fullPath), cont.options = cont.watcher = void 0, Object.freeze(cont));
512
515
  };
513
516
  })(path, absolutePath, options, {
514
517
  listener,
@@ -555,7 +558,7 @@ class NodeFsHandler {
555
558
  }
556
559
  _handleFile(file, stats, initialAdd) {
557
560
  if (this.fsw.closed) return;
558
- let dirname = external_node_path_.dirname(file), basename = external_node_path_.basename(file), parent = this.fsw._getWatchedDir(dirname), prevStats = stats;
561
+ let dirname = __rspack_external_node_path_c5b9b54f.dirname(file), basename = __rspack_external_node_path_c5b9b54f.basename(file), parent = this.fsw._getWatchedDir(dirname), prevStats = stats;
559
562
  if (parent.has(basename)) return;
560
563
  let listener = async (path, newStats)=>{
561
564
  if (this.fsw._throttle('watch', file, 5)) if (newStats && 0 !== newStats.mtimeMs) {
@@ -600,7 +603,7 @@ class NodeFsHandler {
600
603
  this.fsw._symlinkPaths.set(full, !0);
601
604
  }
602
605
  _handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {
603
- directory = external_node_path_.join(directory, '');
606
+ directory = __rspack_external_node_path_c5b9b54f.join(directory, '');
604
607
  let throttleKey = target ? `${directory}:${target}` : directory;
605
608
  if (!(throttler = this.fsw._throttle('readdir', throttleKey, 1000))) return;
606
609
  let previous = this.fsw._getWatchedDir(wh.path), current = new Set(), stream = this.fsw._readdirp(directory, {
@@ -612,13 +615,13 @@ class NodeFsHandler {
612
615
  stream = void 0;
613
616
  return;
614
617
  }
615
- let item = entry.path, path = external_node_path_.join(directory, item);
618
+ let item = entry.path, path = __rspack_external_node_path_c5b9b54f.join(directory, item);
616
619
  if (current.add(item), !(entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path, item))) {
617
620
  if (this.fsw.closed) {
618
621
  stream = void 0;
619
622
  return;
620
623
  }
621
- item !== target && (target || previous.has(item)) || (this.fsw._incrReadyCount(), path = external_node_path_.join(dir, external_node_path_.relative(dir, path)), this._addToNodeFs(path, initialAdd, wh, depth + 1));
624
+ item !== target && (target || previous.has(item)) || (this.fsw._incrReadyCount(), path = __rspack_external_node_path_c5b9b54f.join(dir, __rspack_external_node_path_c5b9b54f.relative(dir, path)), this._addToNodeFs(path, initialAdd, wh, depth + 1));
622
625
  }
623
626
  }).on(EVENTS_ERROR, this._boundHandleError), new Promise((resolve, reject)=>{
624
627
  if (!stream) return reject();
@@ -635,8 +638,8 @@ class NodeFsHandler {
635
638
  });
636
639
  }
637
640
  async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath) {
638
- let throttler, closer, parentDir = this.fsw._getWatchedDir(external_node_path_.dirname(dir)), tracked = parentDir.has(external_node_path_.basename(dir));
639
- initialAdd && this.fsw.options.ignoreInitial || target || tracked || this.fsw._emit(EVENTS_ADD_DIR, dir, stats), parentDir.add(external_node_path_.basename(dir)), this.fsw._getWatchedDir(dir);
641
+ let throttler, closer, parentDir = this.fsw._getWatchedDir(__rspack_external_node_path_c5b9b54f.dirname(dir)), tracked = parentDir.has(__rspack_external_node_path_c5b9b54f.basename(dir));
642
+ initialAdd && this.fsw.options.ignoreInitial || target || tracked || this.fsw._emit(EVENTS_ADD_DIR, dir, stats), parentDir.add(__rspack_external_node_path_c5b9b54f.basename(dir)), this.fsw._getWatchedDir(dir);
640
643
  let oDepth = this.fsw.options.depth;
641
644
  if ((null == oDepth || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath)) {
642
645
  if (!target && (await this._handleRead(dir, initialAdd, wh, target, dir, depth, throttler), this.fsw.closed)) return;
@@ -657,15 +660,15 @@ class NodeFsHandler {
657
660
  if (this.fsw._isIgnored(wh.watchPath, stats)) return ready(), !1;
658
661
  let follow = this.fsw.options.followSymlinks;
659
662
  if (stats.isDirectory()) {
660
- let absPath = external_node_path_.resolve(path), targetPath = follow ? await promises_realpath(path) : path;
663
+ let absPath = __rspack_external_node_path_c5b9b54f.resolve(path), targetPath = follow ? await promises_realpath(path) : path;
661
664
  if (this.fsw.closed || (closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath), this.fsw.closed)) return;
662
665
  absPath !== targetPath && void 0 !== targetPath && this.fsw._symlinkPaths.set(absPath, targetPath);
663
666
  } else if (stats.isSymbolicLink()) {
664
667
  let targetPath = follow ? await promises_realpath(path) : path;
665
668
  if (this.fsw.closed) return;
666
- let parent = external_node_path_.dirname(wh.watchPath);
669
+ let parent = __rspack_external_node_path_c5b9b54f.dirname(wh.watchPath);
667
670
  if (this.fsw._getWatchedDir(parent).add(wh.watchPath), this.fsw._emit(EVENTS_ADD, wh.watchPath, stats), closer = await this._handleDir(parent, stats, initialAdd, depth, path, wh, targetPath), this.fsw.closed) return;
668
- void 0 !== targetPath && this.fsw._symlinkPaths.set(external_node_path_.resolve(path), targetPath);
671
+ void 0 !== targetPath && this.fsw._symlinkPaths.set(__rspack_external_node_path_c5b9b54f.resolve(path), targetPath);
669
672
  } else closer = this._handleFile(wh.watchPath, stats, initialAdd);
670
673
  return ready(), closer && this.fsw._addPathCloser(path, closer), !1;
671
674
  } catch (error) {
@@ -673,7 +676,7 @@ class NodeFsHandler {
673
676
  }
674
677
  }
675
678
  }
676
- let external_node_events_ = __webpack_require__("node:events"), BACK_SLASH_RE = /\\/g, DOUBLE_SLASH_RE = /\/\//g, DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/, REPLACER_RE = /^\.[/\\]/;
679
+ let BACK_SLASH_RE = /\\/g, DOUBLE_SLASH_RE = /\/\//g, DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/, REPLACER_RE = /^\.[/\\]/;
677
680
  function arrify(item) {
678
681
  return Array.isArray(item) ? item : [
679
682
  item
@@ -684,15 +687,15 @@ function createPattern(matcher) {
684
687
  return 'function' == typeof matcher ? matcher : 'string' == typeof matcher ? (string)=>matcher === string : matcher instanceof RegExp ? (string)=>matcher.test(string) : 'object' == typeof matcher && null !== matcher ? (string)=>{
685
688
  if (matcher.path === string) return !0;
686
689
  if (matcher.recursive) {
687
- let relative = external_node_path_.relative(matcher.path, string);
688
- return !!relative && !relative.startsWith('..') && !external_node_path_.isAbsolute(relative);
690
+ let relative = __rspack_external_node_path_c5b9b54f.relative(matcher.path, string);
691
+ return !!relative && !relative.startsWith('..') && !__rspack_external_node_path_c5b9b54f.isAbsolute(relative);
689
692
  }
690
693
  return !1;
691
694
  } : ()=>!1;
692
695
  }
693
696
  function normalizePath(path) {
694
697
  if ('string' != typeof path) throw Error('string expected');
695
- path = (path = external_node_path_.normalize(path)).replace(/\\/g, '/');
698
+ path = (path = __rspack_external_node_path_c5b9b54f.normalize(path)).replace(/\\/g, '/');
696
699
  let prepend = !1;
697
700
  return path.startsWith('//') && (prepend = !0), path = path.replace(DOUBLE_SLASH_RE, '/'), prepend && (path = '/' + path), path;
698
701
  }
@@ -713,7 +716,7 @@ let unifyPaths = (paths_)=>{
713
716
  }, toUnix = (string)=>{
714
717
  let str = string.replace(BACK_SLASH_RE, '/'), prepend = !1;
715
718
  return str.startsWith('//') && (prepend = !0), str = str.replace(DOUBLE_SLASH_RE, '/'), prepend && (str = '/' + str), str;
716
- }, normalizePathToUnix = (path)=>toUnix(external_node_path_.normalize(toUnix(path))), normalizeIgnored = (cwd = '')=>(path)=>'string' == typeof path ? normalizePathToUnix(external_node_path_.isAbsolute(path) ? path : external_node_path_.join(cwd, path)) : path, EMPTY_SET = Object.freeze(new Set());
719
+ }, normalizePathToUnix = (path)=>toUnix(__rspack_external_node_path_c5b9b54f.normalize(toUnix(path))), normalizeIgnored = (cwd = '')=>(path)=>'string' == typeof path ? normalizePathToUnix(__rspack_external_node_path_c5b9b54f.isAbsolute(path) ? path : __rspack_external_node_path_c5b9b54f.join(cwd, path)) : path, EMPTY_SET = Object.freeze(new Set());
717
720
  class DirEntry {
718
721
  path;
719
722
  _removeWatcher;
@@ -732,7 +735,7 @@ class DirEntry {
732
735
  try {
733
736
  await readdir(dir);
734
737
  } catch (err) {
735
- this._removeWatcher && this._removeWatcher(external_node_path_.dirname(dir), external_node_path_.basename(dir));
738
+ this._removeWatcher && this._removeWatcher(__rspack_external_node_path_c5b9b54f.dirname(dir), __rspack_external_node_path_c5b9b54f.basename(dir));
736
739
  }
737
740
  }
738
741
  has(item) {
@@ -760,12 +763,12 @@ class WatchHelper {
760
763
  constructor(path, follow, fsw){
761
764
  this.fsw = fsw;
762
765
  let watchPath = path;
763
- this.path = path = path.replace(REPLACER_RE, ''), this.watchPath = watchPath, this.fullWatchPath = external_node_path_.resolve(watchPath), this.dirParts = [], this.dirParts.forEach((parts)=>{
766
+ this.path = path = path.replace(REPLACER_RE, ''), this.watchPath = watchPath, this.fullWatchPath = __rspack_external_node_path_c5b9b54f.resolve(watchPath), this.dirParts = [], this.dirParts.forEach((parts)=>{
764
767
  parts.length > 1 && parts.pop();
765
768
  }), this.followSymlinks = follow, this.statMethod = follow ? 'stat' : 'lstat';
766
769
  }
767
770
  entryPath(entry) {
768
- return external_node_path_.join(this.watchPath, external_node_path_.relative(this.watchPath, entry.fullPath));
771
+ return __rspack_external_node_path_c5b9b54f.join(this.watchPath, __rspack_external_node_path_c5b9b54f.relative(this.watchPath, entry.fullPath));
769
772
  }
770
773
  filterPath(entry) {
771
774
  let { stats } = entry;
@@ -777,7 +780,7 @@ class WatchHelper {
777
780
  return this.fsw._isntIgnored(this.entryPath(entry), entry.stats);
778
781
  }
779
782
  }
780
- class FSWatcher extends external_node_events_.EventEmitter {
783
+ class FSWatcher extends EventEmitter {
781
784
  closed;
782
785
  options;
783
786
  _closers;
@@ -843,14 +846,14 @@ class FSWatcher extends external_node_events_.EventEmitter {
843
846
  let { cwd } = this.options;
844
847
  this.closed = !1, this._closePromise = void 0;
845
848
  let paths = unifyPaths(paths_);
846
- return cwd && (paths = paths.map((path)=>external_node_path_.isAbsolute(path) ? path : external_node_path_.join(cwd, path))), paths.forEach((path)=>{
849
+ return cwd && (paths = paths.map((path)=>__rspack_external_node_path_c5b9b54f.isAbsolute(path) ? path : __rspack_external_node_path_c5b9b54f.join(cwd, path))), paths.forEach((path)=>{
847
850
  this._removeIgnoredPath(path);
848
851
  }), this._userIgnored = void 0, this._readyCount || (this._readyCount = 0), this._readyCount += paths.length, Promise.all(paths.map(async (path)=>{
849
852
  let res = await this._nodeFsHandler._addToNodeFs(path, !_internal, void 0, 0, _origAdd);
850
853
  return res && this._emitReady(), res;
851
854
  })).then((results)=>{
852
855
  this.closed || results.forEach((item)=>{
853
- item && this.add(external_node_path_.dirname(item), external_node_path_.basename(_origAdd || item));
856
+ item && this.add(__rspack_external_node_path_c5b9b54f.dirname(item), __rspack_external_node_path_c5b9b54f.basename(_origAdd || item));
854
857
  });
855
858
  }), this;
856
859
  }
@@ -858,7 +861,7 @@ class FSWatcher extends external_node_events_.EventEmitter {
858
861
  if (this.closed) return this;
859
862
  let paths = unifyPaths(paths_), { cwd } = this.options;
860
863
  return paths.forEach((path)=>{
861
- external_node_path_.isAbsolute(path) || this._closers.has(path) || (cwd && (path = external_node_path_.join(cwd, path)), path = external_node_path_.resolve(path)), this._closePath(path), this._addIgnoredPath(path), this._watched.has(path) && this._addIgnoredPath({
864
+ __rspack_external_node_path_c5b9b54f.isAbsolute(path) || this._closers.has(path) || (cwd && (path = __rspack_external_node_path_c5b9b54f.join(cwd, path)), path = __rspack_external_node_path_c5b9b54f.resolve(path)), this._closePath(path), this._addIgnoredPath(path), this._watched.has(path) && this._addIgnoredPath({
862
865
  path,
863
866
  recursive: !0
864
867
  }), this._userIgnored = void 0;
@@ -876,7 +879,7 @@ class FSWatcher extends external_node_events_.EventEmitter {
876
879
  getWatched() {
877
880
  let watchList = {};
878
881
  return this._watched.forEach((entry, dir)=>{
879
- watchList[(this.options.cwd ? external_node_path_.relative(this.options.cwd, dir) : dir) || '.'] = entry.getChildren().sort();
882
+ watchList[(this.options.cwd ? __rspack_external_node_path_c5b9b54f.relative(this.options.cwd, dir) : dir) || '.'] = entry.getChildren().sort();
880
883
  }), watchList;
881
884
  }
882
885
  emitWithAll(event, args) {
@@ -886,7 +889,7 @@ class FSWatcher extends external_node_events_.EventEmitter {
886
889
  let pw;
887
890
  if (this.closed) return;
888
891
  let opts = this.options;
889
- isWindows && (path = external_node_path_.normalize(path)), opts.cwd && (path = external_node_path_.relative(opts.cwd, path));
892
+ isWindows && (path = __rspack_external_node_path_c5b9b54f.normalize(path)), opts.cwd && (path = __rspack_external_node_path_c5b9b54f.relative(opts.cwd, path));
890
893
  let args = [
891
894
  path
892
895
  ];
@@ -912,7 +915,7 @@ class FSWatcher extends external_node_events_.EventEmitter {
912
915
  }
913
916
  if (event === EVENTS_CHANGE && !this._throttle(EVENTS_CHANGE, path, 50)) return this;
914
917
  if (opts.alwaysStat && void 0 === stats && (event === EVENTS_ADD || event === EVENTS_ADD_DIR || event === EVENTS_CHANGE)) {
915
- let stats, fullPath = opts.cwd ? external_node_path_.join(opts.cwd, path) : path;
918
+ let stats, fullPath = opts.cwd ? __rspack_external_node_path_c5b9b54f.join(opts.cwd, path) : path;
916
919
  try {
917
920
  stats = await promises_stat(fullPath);
918
921
  } catch (err) {}
@@ -949,10 +952,10 @@ class FSWatcher extends external_node_events_.EventEmitter {
949
952
  let timeoutHandler, awf = this.options.awaitWriteFinish;
950
953
  if ('object' != typeof awf) return;
951
954
  let pollInterval = awf.pollInterval, fullPath = path;
952
- this.options.cwd && !external_node_path_.isAbsolute(path) && (fullPath = external_node_path_.join(this.options.cwd, path));
955
+ this.options.cwd && !__rspack_external_node_path_c5b9b54f.isAbsolute(path) && (fullPath = __rspack_external_node_path_c5b9b54f.join(this.options.cwd, path));
953
956
  let now = new Date(), writes = this._pendingWrites;
954
957
  function awaitWriteFinishFn(prevStat) {
955
- (0, external_node_fs_.stat)(fullPath, (err, curStat)=>{
958
+ external_node_fs_stat(fullPath, (err, curStat)=>{
956
959
  if (err || !writes.has(path)) {
957
960
  err && 'ENOENT' !== err.code && awfEmit(err);
958
961
  return;
@@ -986,28 +989,28 @@ class FSWatcher extends external_node_events_.EventEmitter {
986
989
  return new WatchHelper(path, this.options.followSymlinks, this);
987
990
  }
988
991
  _getWatchedDir(directory) {
989
- let dir = external_node_path_.resolve(directory);
992
+ let dir = __rspack_external_node_path_c5b9b54f.resolve(directory);
990
993
  return this._watched.has(dir) || this._watched.set(dir, new DirEntry(dir, this._boundRemove)), this._watched.get(dir);
991
994
  }
992
995
  _hasReadPermissions(stats) {
993
996
  return !!this.options.ignorePermissionErrors || !!(256 & Number(stats.mode));
994
997
  }
995
998
  _remove(directory, item, isDirectory) {
996
- let path = external_node_path_.join(directory, item), fullPath = external_node_path_.resolve(path);
999
+ let path = __rspack_external_node_path_c5b9b54f.join(directory, item), fullPath = __rspack_external_node_path_c5b9b54f.resolve(path);
997
1000
  if (isDirectory = null != isDirectory ? isDirectory : this._watched.has(path) || this._watched.has(fullPath), !this._throttle('remove', path, 100)) return;
998
1001
  isDirectory || 1 !== this._watched.size || this.add(directory, item, !0), this._getWatchedDir(path).getChildren().forEach((nested)=>this._remove(path, nested));
999
1002
  let parent = this._getWatchedDir(directory), wasTracked = parent.has(item);
1000
1003
  parent.remove(item), this._symlinkPaths.has(fullPath) && this._symlinkPaths.delete(fullPath);
1001
1004
  let relPath = path;
1002
- if (this.options.cwd && (relPath = external_node_path_.relative(this.options.cwd, path)), this.options.awaitWriteFinish && this._pendingWrites.has(relPath) && this._pendingWrites.get(relPath).cancelWait() === EVENTS_ADD) return;
1005
+ if (this.options.cwd && (relPath = __rspack_external_node_path_c5b9b54f.relative(this.options.cwd, path)), this.options.awaitWriteFinish && this._pendingWrites.has(relPath) && this._pendingWrites.get(relPath).cancelWait() === EVENTS_ADD) return;
1003
1006
  this._watched.delete(path), this._watched.delete(fullPath);
1004
1007
  let eventName = isDirectory ? EVENTS_UNLINK_DIR : EVENTS_UNLINK;
1005
1008
  wasTracked && !this._isIgnored(path) && this._emit(eventName, path), this._closePath(path);
1006
1009
  }
1007
1010
  _closePath(path) {
1008
1011
  this._closeFile(path);
1009
- let dir = external_node_path_.dirname(path);
1010
- this._getWatchedDir(dir).remove(external_node_path_.basename(path));
1012
+ let dir = __rspack_external_node_path_c5b9b54f.dirname(path);
1013
+ this._getWatchedDir(dir).remove(__rspack_external_node_path_c5b9b54f.basename(path));
1011
1014
  }
1012
1015
  _closeFile(path) {
1013
1016
  let closers = this._closers.get(path);
@@ -1034,11 +1037,11 @@ class FSWatcher extends external_node_events_.EventEmitter {
1034
1037
  }), stream;
1035
1038
  }
1036
1039
  }
1037
- let chokidar = {
1038
- watch: function watch(paths, options = {}) {
1039
- let watcher = new FSWatcher(options);
1040
- return watcher.add(paths), watcher;
1041
- },
1040
+ function chokidar_watch(paths, options = {}) {
1041
+ let watcher = new FSWatcher(options);
1042
+ return watcher.add(paths), watcher;
1043
+ }
1044
+ export default {
1045
+ watch: chokidar_watch,
1042
1046
  FSWatcher: FSWatcher
1043
1047
  };
1044
- export { chokidar };
@@ -1,4 +1,4 @@
1
- import { logger } from "./59.js";
1
+ import { logger } from "./797.js";
2
2
  let createOverlay;
3
3
  let clearOverlay;
4
4
  function setupCustomHMRListeners(customListenersMap) {
@@ -200,7 +200,7 @@ function init(token, config, serverHost, serverPort, liveReload, browserLogs, lo
200
200
  } else if ('string' == typeof reason) message = reason;
201
201
  else try {
202
202
  message = JSON.stringify(reason);
203
- } catch (_) {
203
+ } catch (unused) {
204
204
  return;
205
205
  }
206
206
  sendError(`Uncaught (in promise) ${message}`, stack);
@@ -232,7 +232,7 @@ function init(token, config, serverHost, serverPort, liveReload, browserLogs, lo
232
232
  });
233
233
  window.addEventListener('unhandledrejection', onUnhandledRejection);
234
234
  }
235
- if (module.hot) setupCustomHMRListeners(customListenersMap);
235
+ if (import.meta.webpackHot) setupCustomHMRListeners(customListenersMap);
236
236
  connect();
237
237
  }
238
238
  export { init, registerOverlay };
@@ -1,5 +1,5 @@
1
1
  import { registerOverlay } from "./hmr.js";
2
- import { logger } from "./59.js";
2
+ import { logger } from "./797.js";
3
3
  function _define_property(obj, key, value) {
4
4
  if (key in obj) Object.defineProperty(obj, key, {
5
5
  value: value,
@@ -201,7 +201,7 @@ function createOverlay(title, content) {
201
201
  const overlay = document.createElement(overlayId);
202
202
  overlay.init(getOverlayHtml(title, content));
203
203
  document.body.appendChild(overlay);
204
- } catch (_err) {
204
+ } catch (unused) {
205
205
  warn();
206
206
  }
207
207
  }