@rspack-canary/browser 1.5.0-canary-efb61069-20250820113456 → 1.5.1-canary-7c68c987-20250828115508

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -35090,39 +35090,92 @@ var __webpack_modules__ = {
35090
35090
  const { readFileSync, readdirSync, lstat, existsSync, readdir, watch } = fs;
35091
35091
  const __WEBPACK_DEFAULT_EXPORT__ = fs;
35092
35092
  },
35093
- "./src/util/require.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
35093
+ "./src/builtin-plugin/base.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
35094
35094
  __webpack_require__.d(__webpack_exports__, {
35095
- y: ()=>nonWebpackRequire
35096
- });
35097
- var node_fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/browser/fs.ts");
35098
- var _rspack_binding__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("@rspack/binding");
35099
- function nonWebpackRequire() {
35100
- return async function(id) {
35101
- return new Promise((resolve, reject)=>{
35102
- (0, _rspack_binding__WEBPACK_IMPORTED_MODULE_1__.async)("", id).then(({ path: loaderPath })=>{
35103
- if (!loaderPath) return void reject(`Cannot find loader of ${id}`);
35104
- node_fs__WEBPACK_IMPORTED_MODULE_0__["default"].readFile(loaderPath, {}, (err, data)=>{
35105
- if (err) return void reject(err);
35106
- const loaderCode = (null == data ? void 0 : data.toString()) || "";
35107
- const codeUrl = URL.createObjectURL(new Blob([
35108
- loaderCode
35109
- ], {
35110
- type: "text/javascript"
35111
- }));
35112
- try {
35113
- const modulePromise = eval(`import("${codeUrl}")`);
35114
- modulePromise.then((module)=>{
35115
- URL.revokeObjectURL(codeUrl);
35116
- resolve(module);
35117
- });
35118
- } catch (e) {
35119
- reject(e);
35120
- }
35121
- });
35122
- }).catch((err)=>reject(err));
35123
- });
35095
+ Gp: ()=>canInherentFromParent,
35096
+ Xj: ()=>RspackBuiltinPlugin,
35097
+ dE: ()=>createNativePlugin,
35098
+ no: ()=>createBuiltinPlugin,
35099
+ vt: ()=>create
35100
+ });
35101
+ var _rspack_binding__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("@rspack/binding");
35102
+ function _define_property(obj, key, value) {
35103
+ if (key in obj) Object.defineProperty(obj, key, {
35104
+ value: value,
35105
+ enumerable: true,
35106
+ configurable: true,
35107
+ writable: true
35108
+ });
35109
+ else obj[key] = value;
35110
+ return obj;
35111
+ }
35112
+ const HOOKS_CAN_NOT_INHERENT_FROM_PARENT = [
35113
+ "make",
35114
+ "compile",
35115
+ "emit",
35116
+ "afterEmit",
35117
+ "invalid",
35118
+ "done",
35119
+ "thisCompilation"
35120
+ ];
35121
+ function canInherentFromParent(affectedHooks) {
35122
+ if (void 0 === affectedHooks) return false;
35123
+ return !HOOKS_CAN_NOT_INHERENT_FROM_PARENT.includes(affectedHooks);
35124
+ }
35125
+ class RspackBuiltinPlugin {
35126
+ apply(compiler) {
35127
+ const raw = this.raw(compiler);
35128
+ if (raw) {
35129
+ raw.canInherentFromParent = canInherentFromParent(this.affectedHooks);
35130
+ compiler.__internal__registerBuiltinPlugin(raw);
35131
+ }
35132
+ }
35133
+ constructor(){
35134
+ _define_property(this, "affectedHooks", void 0);
35135
+ }
35136
+ }
35137
+ function createBuiltinPlugin(name, options) {
35138
+ return {
35139
+ name: name,
35140
+ options: options ?? false
35124
35141
  };
35125
35142
  }
35143
+ function create(name, resolve, affectedHooks) {
35144
+ class Plugin extends RspackBuiltinPlugin {
35145
+ raw(compiler) {
35146
+ return createBuiltinPlugin(name, resolve.apply(compiler, this._args));
35147
+ }
35148
+ constructor(...args){
35149
+ super(), _define_property(this, "name", name), _define_property(this, "_args", void 0), _define_property(this, "affectedHooks", affectedHooks);
35150
+ this._args = args;
35151
+ }
35152
+ }
35153
+ Object.defineProperty(Plugin, "name", {
35154
+ value: name
35155
+ });
35156
+ return Plugin;
35157
+ }
35158
+ const INTERNAL_PLUGIN_NAMES = Object.keys(_rspack_binding__WEBPACK_IMPORTED_MODULE_0__["default"].BuiltinPluginName);
35159
+ function createNativePlugin(name, resolve, affectedHooks) {
35160
+ if (INTERNAL_PLUGIN_NAMES.includes(name)) throw new Error(`Cannot register native plugin with name '${name}', it conflicts with internal plugin names.`);
35161
+ return create(name, resolve, affectedHooks);
35162
+ }
35163
+ },
35164
+ "./src/builtin-plugin/lazy-compilation/lazyCompilation.ts": function(module, __webpack_exports__, __webpack_require__) {
35165
+ __webpack_require__.d(__webpack_exports__, {
35166
+ a: ()=>BuiltinLazyCompilationPlugin
35167
+ });
35168
+ var external_rspack_wasi_browser_js_ = __webpack_require__("@rspack/binding");
35169
+ var base = __webpack_require__("./src/builtin-plugin/base.ts");
35170
+ module = __webpack_require__.hmd(module);
35171
+ const BuiltinLazyCompilationPlugin = (0, base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.LazyCompilationPlugin, (currentActiveModules, entries, imports, client, test)=>({
35172
+ module,
35173
+ imports,
35174
+ entries,
35175
+ test,
35176
+ client,
35177
+ currentActiveModules
35178
+ }), "thisCompilation");
35126
35179
  },
35127
35180
  "@rspack/binding": function(module) {
35128
35181
  module.exports = __WEBPACK_EXTERNAL_MODULE__rspack_wasi_browser_js_bd433424__;
@@ -35379,6 +35432,19 @@ function __webpack_require__(moduleId) {
35379
35432
  });
35380
35433
  };
35381
35434
  })();
35435
+ (()=>{
35436
+ __webpack_require__.hmd = (module)=>{
35437
+ module = Object.create(module);
35438
+ if (!module.children) module.children = [];
35439
+ Object.defineProperty(module, 'exports', {
35440
+ enumerable: true,
35441
+ set: ()=>{
35442
+ throw new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);
35443
+ }
35444
+ });
35445
+ return module;
35446
+ };
35447
+ })();
35382
35448
  (()=>{
35383
35449
  __webpack_require__.g = (()=>{
35384
35450
  if ('object' == typeof globalThis) return globalThis;
@@ -37725,72 +37791,12 @@ class Entries {
37725
37791
  Compilation_class_private_field_set(this, _data, data);
37726
37792
  }
37727
37793
  }
37728
- function base_define_property(obj, key, value) {
37729
- if (key in obj) Object.defineProperty(obj, key, {
37730
- value: value,
37731
- enumerable: true,
37732
- configurable: true,
37733
- writable: true
37734
- });
37735
- else obj[key] = value;
37736
- return obj;
37737
- }
37738
- const HOOKS_CAN_NOT_INHERENT_FROM_PARENT = [
37739
- "make",
37740
- "compile",
37741
- "emit",
37742
- "afterEmit",
37743
- "invalid",
37744
- "done",
37745
- "thisCompilation"
37746
- ];
37747
- function canInherentFromParent(affectedHooks) {
37748
- if (void 0 === affectedHooks) return false;
37749
- return !HOOKS_CAN_NOT_INHERENT_FROM_PARENT.includes(affectedHooks);
37750
- }
37751
- class RspackBuiltinPlugin {
37752
- apply(compiler) {
37753
- const raw = this.raw(compiler);
37754
- if (raw) {
37755
- raw.canInherentFromParent = canInherentFromParent(this.affectedHooks);
37756
- compiler.__internal__registerBuiltinPlugin(raw);
37757
- }
37758
- }
37759
- constructor(){
37760
- base_define_property(this, "affectedHooks", void 0);
37761
- }
37762
- }
37763
- function createBuiltinPlugin(name, options) {
37764
- return {
37765
- name: name,
37766
- options: options ?? false
37767
- };
37768
- }
37769
- function base_create(name, resolve, affectedHooks) {
37770
- class Plugin extends RspackBuiltinPlugin {
37771
- raw(compiler) {
37772
- return createBuiltinPlugin(name, resolve.apply(compiler, this._args));
37773
- }
37774
- constructor(...args){
37775
- super(), base_define_property(this, "name", name), base_define_property(this, "_args", void 0), base_define_property(this, "affectedHooks", affectedHooks);
37776
- this._args = args;
37777
- }
37778
- }
37779
- Object.defineProperty(Plugin, "name", {
37780
- value: name
37781
- });
37782
- return Plugin;
37783
- }
37784
- const INTERNAL_PLUGIN_NAMES = Object.keys(external_rspack_wasi_browser_js_["default"].BuiltinPluginName);
37785
- function createNativePlugin(name, resolve, affectedHooks) {
37786
- if (INTERNAL_PLUGIN_NAMES.includes(name)) throw new Error(`Cannot register native plugin with name '${name}', it conflicts with internal plugin names.`);
37787
- return base_create(name, resolve, affectedHooks);
37788
- }
37789
- const APIPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.APIPlugin, ()=>{});
37790
- const ArrayPushCallbackChunkFormatPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.ArrayPushCallbackChunkFormatPlugin, ()=>{});
37791
- const AssetModulesPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.AssetModulesPlugin, ()=>{}, "compilation");
37792
- const AsyncWebAssemblyModulesPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.AsyncWebAssemblyModulesPlugin, ()=>{}, "compilation");
37793
- const BannerPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.BannerPlugin, (args)=>{
37794
+ var builtin_plugin_base = __webpack_require__("./src/builtin-plugin/base.ts");
37795
+ const APIPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.APIPlugin, ()=>{});
37796
+ const ArrayPushCallbackChunkFormatPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.ArrayPushCallbackChunkFormatPlugin, ()=>{});
37797
+ const AssetModulesPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.AssetModulesPlugin, ()=>{}, "compilation");
37798
+ const AsyncWebAssemblyModulesPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.AsyncWebAssemblyModulesPlugin, ()=>{}, "compilation");
37799
+ const BannerPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.BannerPlugin, (args)=>{
37794
37800
  if ("string" == typeof args || "function" == typeof args) return {
37795
37801
  banner: args
37796
37802
  };
@@ -37805,12 +37811,12 @@ const BannerPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginN
37805
37811
  exclude: args.exclude
37806
37812
  };
37807
37813
  });
37808
- const BundlerInfoRspackPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.BundlerInfoRspackPlugin, (options)=>({
37814
+ const BundlerInfoRspackPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.BundlerInfoRspackPlugin, (options)=>({
37809
37815
  version: options.version || "unknown",
37810
37816
  bundler: options.bundler || "rspack",
37811
37817
  force: options.force ?? true
37812
37818
  }));
37813
- const ChunkPrefetchPreloadPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.ChunkPrefetchPreloadPlugin, ()=>{});
37819
+ const ChunkPrefetchPreloadPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.ChunkPrefetchPreloadPlugin, ()=>{});
37814
37820
  function CircularDependencyRspackPlugin_define_property(obj, key, value) {
37815
37821
  if (key in obj) Object.defineProperty(obj, key, {
37816
37822
  value: value,
@@ -37821,7 +37827,7 @@ function CircularDependencyRspackPlugin_define_property(obj, key, value) {
37821
37827
  else obj[key] = value;
37822
37828
  return obj;
37823
37829
  }
37824
- class CircularDependencyRspackPlugin extends RspackBuiltinPlugin {
37830
+ class CircularDependencyRspackPlugin extends builtin_plugin_base.Xj {
37825
37831
  raw(compiler) {
37826
37832
  const { failOnError, allowAsyncCycles, exclude, ignoredConnections } = this._options;
37827
37833
  const rawOptions = {
@@ -37846,15 +37852,15 @@ class CircularDependencyRspackPlugin extends RspackBuiltinPlugin {
37846
37852
  this._options.onEnd(compilation);
37847
37853
  } : void 0
37848
37854
  };
37849
- return createBuiltinPlugin(this.name, rawOptions);
37855
+ return (0, builtin_plugin_base.no)(this.name, rawOptions);
37850
37856
  }
37851
37857
  constructor(options){
37852
37858
  super(), CircularDependencyRspackPlugin_define_property(this, "name", external_rspack_wasi_browser_js_.BuiltinPluginName.CircularDependencyRspackPlugin), CircularDependencyRspackPlugin_define_property(this, "_options", void 0);
37853
37859
  this._options = options;
37854
37860
  }
37855
37861
  }
37856
- const CommonJsChunkFormatPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.CommonJsChunkFormatPlugin, ()=>{});
37857
- const ContextReplacementPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.ContextReplacementPlugin, (resourceRegExp, newContentResource, newContentRecursive, newContentRegExp)=>{
37862
+ const CommonJsChunkFormatPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.CommonJsChunkFormatPlugin, ()=>{});
37863
+ const ContextReplacementPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.ContextReplacementPlugin, (resourceRegExp, newContentResource, newContentRecursive, newContentRegExp)=>{
37858
37864
  const rawOptions = {
37859
37865
  resourceRegExp
37860
37866
  };
@@ -37879,7 +37885,7 @@ const ContextReplacementPlugin = base_create(external_rspack_wasi_browser_js_.Bu
37879
37885
  }
37880
37886
  return rawOptions;
37881
37887
  });
37882
- const CopyRspackPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.CopyRspackPlugin, (copy)=>{
37888
+ const CopyRspackPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.CopyRspackPlugin, (copy)=>{
37883
37889
  const ret = {
37884
37890
  patterns: []
37885
37891
  };
@@ -37899,7 +37905,7 @@ const CopyRspackPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPlu
37899
37905
  });
37900
37906
  return ret;
37901
37907
  });
37902
- const CssChunkingPlugin = base_create(external_rspack_wasi_browser_js_["default"].BuiltinPluginName.CssChunkingPlugin, function(options = {}) {
37908
+ const CssChunkingPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_["default"].BuiltinPluginName.CssChunkingPlugin, function(options = {}) {
37903
37909
  if (options.nextjs) return {
37904
37910
  strict: options.strict,
37905
37911
  minSize: options.minSize,
@@ -37915,7 +37921,7 @@ const CssChunkingPlugin = base_create(external_rspack_wasi_browser_js_["default"
37915
37921
  }
37916
37922
  return options;
37917
37923
  });
37918
- const CssModulesPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.CssModulesPlugin, ()=>{}, "compilation");
37924
+ const CssModulesPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.CssModulesPlugin, ()=>{}, "compilation");
37919
37925
  var path_browserify = __webpack_require__("../../node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js");
37920
37926
  var path_browserify_default = /*#__PURE__*/ __webpack_require__.n(path_browserify);
37921
37927
  const utils_PLUGIN_NAME = "css-extract-rspack-plugin";
@@ -37982,8 +37988,8 @@ class CssExtractRspackPlugin {
37982
37988
  }
37983
37989
  css_extract_define_property(CssExtractRspackPlugin, "pluginName", utils_PLUGIN_NAME);
37984
37990
  css_extract_define_property(CssExtractRspackPlugin, "loader", LOADER_PATH);
37985
- const DataUriPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.DataUriPlugin, ()=>{}, "compilation");
37986
- const DefinePlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.DefinePlugin, function(define1) {
37991
+ const DataUriPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.DataUriPlugin, ()=>{}, "compilation");
37992
+ const DefinePlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.DefinePlugin, function(define1) {
37987
37993
  var _this_options_output_environment;
37988
37994
  const supportsBigIntLiteral = (null == (_this_options_output_environment = this.options.output.environment) ? void 0 : _this_options_output_environment.bigIntLiteral) ?? false;
37989
37995
  return normalizeValue(define1, supportsBigIntLiteral);
@@ -38021,9 +38027,9 @@ function DeterministicChunkIdsPlugin_define_property(obj, key, value) {
38021
38027
  else obj[key] = value;
38022
38028
  return obj;
38023
38029
  }
38024
- class DeterministicChunkIdsPlugin extends RspackBuiltinPlugin {
38030
+ class DeterministicChunkIdsPlugin extends builtin_plugin_base.Xj {
38025
38031
  raw(compiler) {
38026
- return createBuiltinPlugin(this.name, void 0);
38032
+ return (0, builtin_plugin_base.no)(this.name, void 0);
38027
38033
  }
38028
38034
  constructor(...args){
38029
38035
  super(...args), DeterministicChunkIdsPlugin_define_property(this, "name", external_rspack_wasi_browser_js_.BuiltinPluginName.DeterministicChunkIdsPlugin), DeterministicChunkIdsPlugin_define_property(this, "affectedHooks", "compilation");
@@ -38039,20 +38045,20 @@ function DeterministicModuleIdsPlugin_define_property(obj, key, value) {
38039
38045
  else obj[key] = value;
38040
38046
  return obj;
38041
38047
  }
38042
- class DeterministicModuleIdsPlugin extends RspackBuiltinPlugin {
38048
+ class DeterministicModuleIdsPlugin extends builtin_plugin_base.Xj {
38043
38049
  raw(compiler) {
38044
- return createBuiltinPlugin(this.name, void 0);
38050
+ return (0, builtin_plugin_base.no)(this.name, void 0);
38045
38051
  }
38046
38052
  constructor(...args){
38047
38053
  super(...args), DeterministicModuleIdsPlugin_define_property(this, "name", external_rspack_wasi_browser_js_.BuiltinPluginName.DeterministicModuleIdsPlugin), DeterministicModuleIdsPlugin_define_property(this, "affectedHooks", "compilation");
38048
38054
  }
38049
38055
  }
38050
- const DllEntryPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.DllEntryPlugin, (context, entries, options)=>({
38056
+ const DllEntryPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.DllEntryPlugin, (context, entries, options)=>({
38051
38057
  context,
38052
38058
  entries,
38053
38059
  name: options.name
38054
38060
  }));
38055
- const DllReferenceAgencyPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.DllReferenceAgencyPlugin, (options)=>options);
38061
+ const DllReferenceAgencyPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.DllReferenceAgencyPlugin, (options)=>options);
38056
38062
  var assert = __webpack_require__("../../node_modules/.pnpm/assert@2.1.0/node_modules/assert/build/assert.js");
38057
38063
  var assert_default = /*#__PURE__*/ __webpack_require__.n(assert);
38058
38064
  class EntryOptionPlugin {
@@ -38089,7 +38095,7 @@ class EntryOptionPlugin {
38089
38095
  }
38090
38096
  }
38091
38097
  const lib_EntryOptionPlugin = EntryOptionPlugin;
38092
- const OriginEntryPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.EntryPlugin, (context, entry, options = "")=>{
38098
+ const OriginEntryPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.EntryPlugin, (context, entry, options = "")=>{
38093
38099
  const entryOptions = "string" == typeof options ? {
38094
38100
  name: options
38095
38101
  } : options;
@@ -38127,7 +38133,7 @@ function DynamicEntryPlugin_define_property(obj, key, value) {
38127
38133
  else obj[key] = value;
38128
38134
  return obj;
38129
38135
  }
38130
- class DynamicEntryPlugin extends RspackBuiltinPlugin {
38136
+ class DynamicEntryPlugin extends builtin_plugin_base.Xj {
38131
38137
  raw(compiler) {
38132
38138
  const raw = {
38133
38139
  context: this.context,
@@ -38142,14 +38148,14 @@ class DynamicEntryPlugin extends RspackBuiltinPlugin {
38142
38148
  });
38143
38149
  }
38144
38150
  };
38145
- return createBuiltinPlugin(this.name, raw);
38151
+ return (0, builtin_plugin_base.no)(this.name, raw);
38146
38152
  }
38147
38153
  constructor(context, entry){
38148
38154
  super(), DynamicEntryPlugin_define_property(this, "context", void 0), DynamicEntryPlugin_define_property(this, "entry", void 0), DynamicEntryPlugin_define_property(this, "name", void 0), DynamicEntryPlugin_define_property(this, "affectedHooks", void 0), this.context = context, this.entry = entry, this.name = external_rspack_wasi_browser_js_.BuiltinPluginName.DynamicEntryPlugin, this.affectedHooks = "make";
38149
38155
  }
38150
38156
  }
38151
- const ElectronTargetPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.ElectronTargetPlugin, (context)=>context ?? "none");
38152
- const EnableChunkLoadingPluginInner = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.EnableChunkLoadingPlugin, (type)=>type);
38157
+ const ElectronTargetPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.ElectronTargetPlugin, (context)=>context ?? "none");
38158
+ const EnableChunkLoadingPluginInner = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.EnableChunkLoadingPlugin, (type)=>type);
38153
38159
  const enabledTypes = new WeakMap();
38154
38160
  const getEnabledTypes = (compiler)=>{
38155
38161
  let set = enabledTypes.get(compiler);
@@ -38209,7 +38215,7 @@ const EnableLibraryPlugin_getEnabledTypes = (compiler)=>{
38209
38215
  }
38210
38216
  return set;
38211
38217
  };
38212
- class EnableLibraryPlugin extends RspackBuiltinPlugin {
38218
+ class EnableLibraryPlugin extends builtin_plugin_base.Xj {
38213
38219
  static setEnabled(compiler, type) {
38214
38220
  EnableLibraryPlugin_getEnabledTypes(compiler).add(type);
38215
38221
  }
@@ -38221,16 +38227,16 @@ class EnableLibraryPlugin extends RspackBuiltinPlugin {
38221
38227
  const enabled = EnableLibraryPlugin_getEnabledTypes(compiler);
38222
38228
  if (enabled.has(type)) return;
38223
38229
  enabled.add(type);
38224
- return createBuiltinPlugin(this.name, type);
38230
+ return (0, builtin_plugin_base.no)(this.name, type);
38225
38231
  }
38226
38232
  constructor(type){
38227
38233
  super(), EnableLibraryPlugin_define_property(this, "type", void 0), EnableLibraryPlugin_define_property(this, "name", void 0), this.type = type, this.name = external_rspack_wasi_browser_js_.BuiltinPluginName.EnableLibraryPlugin;
38228
38234
  }
38229
38235
  }
38230
- const EnableWasmLoadingPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.EnableWasmLoadingPlugin, (type)=>type);
38231
- const EnsureChunkConditionsPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.EnsureChunkConditionsPlugin, ()=>{});
38232
- const EvalDevToolModulePlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.EvalDevToolModulePlugin, (options)=>options, "compilation");
38233
- const EvalSourceMapDevToolPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.EvalSourceMapDevToolPlugin, (options)=>options, "compilation");
38236
+ const EnableWasmLoadingPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.EnableWasmLoadingPlugin, (type)=>type);
38237
+ const EnsureChunkConditionsPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.EnsureChunkConditionsPlugin, ()=>{});
38238
+ const EvalDevToolModulePlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.EvalDevToolModulePlugin, (options)=>options, "compilation");
38239
+ const EvalSourceMapDevToolPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.EvalSourceMapDevToolPlugin, (options)=>options, "compilation");
38234
38240
  function isNil(value) {
38235
38241
  return null == value;
38236
38242
  }
@@ -38710,11 +38716,11 @@ function trace_define_property(obj, key, value) {
38710
38716
  }
38711
38717
  class JavaScriptTracer {
38712
38718
  static async initJavaScriptTrace(layer, output) {
38713
- const { Session } = __webpack_require__(Object(function() {
38719
+ const { Session } = await Promise.resolve().then(function() {
38714
38720
  var e = new Error("Cannot find module 'node:inspector'");
38715
38721
  e.code = 'MODULE_NOT_FOUND';
38716
38722
  throw e;
38717
- }()));
38723
+ });
38718
38724
  this.session = new Session();
38719
38725
  this.layer = layer;
38720
38726
  this.output = output;
@@ -39188,7 +39194,6 @@ class ModuleWarning extends lib_WebpackError {
39188
39194
  async function service_run() {
39189
39195
  throw new Error("Not support browser");
39190
39196
  }
39191
- var util_require = __webpack_require__("./src/util/require.ts");
39192
39197
  class LoadingLoaderError extends Error {
39193
39198
  constructor(message){
39194
39199
  super(message);
@@ -39198,9 +39203,15 @@ class LoadingLoaderError extends Error {
39198
39203
  }
39199
39204
  const LoaderLoadingError = LoadingLoaderError;
39200
39205
  function loadLoader(loader, compiler, callback) {
39201
- (0, util_require.y)()(loader.path).then((module)=>{
39202
- handleResult(loader, module, callback);
39203
- }, callback);
39206
+ {
39207
+ let module;
39208
+ try {
39209
+ module = compiler.__internal_browser_require(loader.path);
39210
+ } catch (e) {
39211
+ return callback(e);
39212
+ }
39213
+ return handleResult(loader, module, callback);
39214
+ }
39204
39215
  }
39205
39216
  function handleResult(loader, module, callback) {
39206
39217
  if ("function" != typeof module && "object" != typeof module) return callback(new LoaderLoadingError(`Module '${loader.path}' is not a loader (export function or es6 module)`));
@@ -40605,7 +40616,7 @@ function ExternalsPlugin_define_property(obj, key, value) {
40605
40616
  return obj;
40606
40617
  }
40607
40618
  var _resolveRequestCache = /*#__PURE__*/ new WeakMap(), _processResolveResult = /*#__PURE__*/ new WeakMap(), _processRequest = /*#__PURE__*/ new WeakSet(), _getRawExternalItem = /*#__PURE__*/ new WeakMap();
40608
- class ExternalsPlugin extends RspackBuiltinPlugin {
40619
+ class ExternalsPlugin extends builtin_plugin_base.Xj {
40609
40620
  raw() {
40610
40621
  const type = this.type;
40611
40622
  const externals = this.externals;
@@ -40613,12 +40624,13 @@ class ExternalsPlugin extends RspackBuiltinPlugin {
40613
40624
  type,
40614
40625
  externals: (Array.isArray(externals) ? externals : [
40615
40626
  externals
40616
- ]).filter(Boolean).map((item)=>ExternalsPlugin_class_private_field_get(this, _getRawExternalItem).call(this, item))
40627
+ ]).filter(Boolean).map((item)=>ExternalsPlugin_class_private_field_get(this, _getRawExternalItem).call(this, item)),
40628
+ placeInInitial: this.placeInInitial ?? false
40617
40629
  };
40618
- return createBuiltinPlugin(this.name, raw);
40630
+ return (0, builtin_plugin_base.no)(this.name, raw);
40619
40631
  }
40620
- constructor(type, externals){
40621
- super(), ExternalsPlugin_class_private_method_init(this, _processRequest), ExternalsPlugin_define_property(this, "type", void 0), ExternalsPlugin_define_property(this, "externals", void 0), ExternalsPlugin_define_property(this, "name", void 0), ExternalsPlugin_class_private_field_init(this, _resolveRequestCache, {
40632
+ constructor(type, externals, placeInInitial){
40633
+ super(), ExternalsPlugin_class_private_method_init(this, _processRequest), ExternalsPlugin_define_property(this, "type", void 0), ExternalsPlugin_define_property(this, "externals", void 0), ExternalsPlugin_define_property(this, "placeInInitial", void 0), ExternalsPlugin_define_property(this, "name", void 0), ExternalsPlugin_class_private_field_init(this, _resolveRequestCache, {
40622
40634
  writable: true,
40623
40635
  value: void 0
40624
40636
  }), ExternalsPlugin_class_private_field_init(this, _processResolveResult, {
@@ -40627,7 +40639,7 @@ class ExternalsPlugin extends RspackBuiltinPlugin {
40627
40639
  }), ExternalsPlugin_class_private_field_init(this, _getRawExternalItem, {
40628
40640
  writable: true,
40629
40641
  value: void 0
40630
- }), this.type = type, this.externals = externals, this.name = external_rspack_wasi_browser_js_.BuiltinPluginName.ExternalsPlugin, ExternalsPlugin_class_private_field_set(this, _resolveRequestCache, new Map()), ExternalsPlugin_class_private_field_set(this, _processResolveResult, (text)=>{
40642
+ }), this.type = type, this.externals = externals, this.placeInInitial = placeInInitial, this.name = external_rspack_wasi_browser_js_.BuiltinPluginName.ExternalsPlugin, ExternalsPlugin_class_private_field_set(this, _resolveRequestCache, new Map()), ExternalsPlugin_class_private_field_set(this, _processResolveResult, (text)=>{
40631
40643
  if (!text) return;
40632
40644
  let resolveRequest = ExternalsPlugin_class_private_field_get(this, _resolveRequestCache).get(text);
40633
40645
  if (!resolveRequest) {
@@ -40711,9 +40723,9 @@ function getRawExternalItemValue(value) {
40711
40723
  ]));
40712
40724
  return value;
40713
40725
  }
40714
- const FetchCompileAsyncWasmPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.FetchCompileAsyncWasmPlugin, ()=>{}, "thisCompilation");
40715
- const FileUriPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.FileUriPlugin, ()=>{}, "compilation");
40716
- const FlagDependencyExportsPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.FlagDependencyExportsPlugin, ()=>{}, "compilation");
40726
+ const FetchCompileAsyncWasmPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.FetchCompileAsyncWasmPlugin, ()=>{}, "thisCompilation");
40727
+ const FileUriPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.FileUriPlugin, ()=>{}, "compilation");
40728
+ const FlagDependencyExportsPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.FlagDependencyExportsPlugin, ()=>{}, "compilation");
40717
40729
  function FlagDependencyUsagePlugin_define_property(obj, key, value) {
40718
40730
  if (key in obj) Object.defineProperty(obj, key, {
40719
40731
  value: value,
@@ -40724,9 +40736,9 @@ function FlagDependencyUsagePlugin_define_property(obj, key, value) {
40724
40736
  else obj[key] = value;
40725
40737
  return obj;
40726
40738
  }
40727
- class FlagDependencyUsagePlugin extends RspackBuiltinPlugin {
40739
+ class FlagDependencyUsagePlugin extends builtin_plugin_base.Xj {
40728
40740
  raw(compiler) {
40729
- return createBuiltinPlugin(this.name, this.global);
40741
+ return (0, builtin_plugin_base.no)(this.name, this.global);
40730
40742
  }
40731
40743
  constructor(global){
40732
40744
  super(), FlagDependencyUsagePlugin_define_property(this, "global", void 0), FlagDependencyUsagePlugin_define_property(this, "name", void 0), FlagDependencyUsagePlugin_define_property(this, "affectedHooks", void 0), this.global = global, this.name = external_rspack_wasi_browser_js_.BuiltinPluginName.FlagDependencyUsagePlugin, this.affectedHooks = "compilation";
@@ -40742,16 +40754,16 @@ function HotModuleReplacementPlugin_define_property(obj, key, value) {
40742
40754
  else obj[key] = value;
40743
40755
  return obj;
40744
40756
  }
40745
- class HotModuleReplacementPlugin extends RspackBuiltinPlugin {
40757
+ class HotModuleReplacementPlugin extends builtin_plugin_base.Xj {
40746
40758
  raw(compiler) {
40747
40759
  if (void 0 === compiler.options.output.strictModuleErrorHandling) compiler.options.output.strictModuleErrorHandling = true;
40748
- return createBuiltinPlugin(this.name, void 0);
40760
+ return (0, builtin_plugin_base.no)(this.name, void 0);
40749
40761
  }
40750
40762
  constructor(...args){
40751
40763
  super(...args), HotModuleReplacementPlugin_define_property(this, "name", external_rspack_wasi_browser_js_.BuiltinPluginName.HotModuleReplacementPlugin);
40752
40764
  }
40753
40765
  }
40754
- const HttpExternalsRspackPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.HttpExternalsRspackPlugin, (css, webAsync)=>({
40766
+ const HttpExternalsRspackPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.HttpExternalsRspackPlugin, (css, webAsync)=>({
40755
40767
  css,
40756
40768
  webAsync
40757
40769
  }));
@@ -40765,52 +40777,27 @@ function HttpUriPlugin_define_property(obj, key, value) {
40765
40777
  else obj[key] = value;
40766
40778
  return obj;
40767
40779
  }
40768
- const getHttp = memoize(()=>__webpack_require__("../../node_modules/.pnpm/stream-http@3.2.0/node_modules/stream-http/index.js"));
40769
- const getHttps = memoize(()=>__webpack_require__("../../node_modules/.pnpm/https-browserify@1.0.0/node_modules/https-browserify/index.js"));
40770
- function fetch(url, options) {
40771
- const parsedURL = new URL(url);
40772
- const send = "https:" === parsedURL.protocol ? getHttps() : getHttp();
40773
- const { createBrotliDecompress, createGunzip, createInflate } = __webpack_require__("../../node_modules/.pnpm/browserify-zlib@0.2.0/node_modules/browserify-zlib/lib/index.js");
40774
- return new Promise((resolve, reject)=>{
40775
- send.get(url, options, (res)=>{
40776
- const contentEncoding = res.headers["content-encoding"];
40777
- let stream = res;
40778
- if ("gzip" === contentEncoding) stream = stream.pipe(createGunzip());
40779
- else if ("br" === contentEncoding) stream = stream.pipe(createBrotliDecompress());
40780
- else if ("deflate" === contentEncoding) stream = stream.pipe(createInflate());
40781
- const chunks = [];
40782
- stream.on("data", (chunk)=>{
40783
- chunks.push(chunk);
40784
- });
40785
- stream.on("end", ()=>{
40786
- const bodyBuffer = Buffer.concat(chunks);
40787
- if (!res.complete) return void reject(new Error(`${url} request was terminated early`));
40788
- resolve({
40789
- res,
40790
- body: bodyBuffer
40791
- });
40792
- });
40793
- }).on("error", reject);
40794
- });
40795
- }
40796
- const defaultHttpClient = async (url, headers)=>{
40797
- const { res, body } = await fetch(url, {
40780
+ memoize(()=>__webpack_require__("../../node_modules/.pnpm/stream-http@3.2.0/node_modules/stream-http/index.js"));
40781
+ memoize(()=>__webpack_require__("../../node_modules/.pnpm/https-browserify@1.0.0/node_modules/https-browserify/index.js"));
40782
+ const defaultHttpClientForBrowser = async (url, headers)=>{
40783
+ const res = await fetch(url, {
40798
40784
  headers
40799
40785
  });
40800
40786
  const responseHeaders = {};
40801
40787
  for (const [key, value] of Object.entries(res.headers))if (Array.isArray(value)) responseHeaders[key] = value.join(", ");
40802
40788
  else responseHeaders[key] = value;
40803
40789
  return {
40804
- status: res.statusCode,
40790
+ status: res.status,
40805
40791
  headers: responseHeaders,
40806
- body: Buffer.from(body)
40792
+ body: Buffer.from(await res.arrayBuffer())
40807
40793
  };
40808
40794
  };
40809
- class HttpUriPlugin extends RspackBuiltinPlugin {
40795
+ class HttpUriPlugin extends builtin_plugin_base.Xj {
40810
40796
  raw(compiler) {
40811
40797
  const options = this.options;
40812
40798
  const lockfileLocation = options.lockfileLocation ?? path_browserify_default().join(compiler.context, compiler.name ? `${compiler.name}.rspack.lock` : "rspack.lock");
40813
40799
  const cacheLocation = false === options.cacheLocation ? void 0 : options.cacheLocation ?? `${lockfileLocation}.data`;
40800
+ const defaultHttpClient = defaultHttpClientForBrowser;
40814
40801
  const raw = {
40815
40802
  allowedUris: options.allowedUris,
40816
40803
  lockfileLocation,
@@ -40818,7 +40805,7 @@ class HttpUriPlugin extends RspackBuiltinPlugin {
40818
40805
  upgrade: options.upgrade ?? false,
40819
40806
  httpClient: options.httpClient ?? defaultHttpClient
40820
40807
  };
40821
- return createBuiltinPlugin(this.name, raw);
40808
+ return (0, builtin_plugin_base.no)(this.name, raw);
40822
40809
  }
40823
40810
  constructor(options){
40824
40811
  super(), HttpUriPlugin_define_property(this, "options", void 0), HttpUriPlugin_define_property(this, "name", void 0), HttpUriPlugin_define_property(this, "affectedHooks", void 0), this.options = options, this.name = external_rspack_wasi_browser_js_.BuiltinPluginName.HttpUriPlugin, this.affectedHooks = "compilation";
@@ -44996,7 +44983,7 @@ const cleanPluginHooks = (compilation)=>{
44996
44983
  };
44997
44984
  var plugin_process = __webpack_require__("../../node_modules/.pnpm/process@0.11.10/node_modules/process/browser.js");
44998
44985
  let HTML_PLUGIN_UID = 0;
44999
- const HtmlRspackPluginImpl = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.HtmlRspackPlugin, function(c = {}) {
44986
+ const HtmlRspackPluginImpl = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.HtmlRspackPlugin, function(c = {}) {
45000
44987
  validateHtmlPluginOptions(c);
45001
44988
  const uid = HTML_PLUGIN_UID++;
45002
44989
  const meta = {};
@@ -45072,7 +45059,7 @@ const HtmlRspackPluginImpl = base_create(external_rspack_wasi_browser_js_.Builti
45072
45059
  const templateFilePath = path_browserify_default().resolve(context, filename);
45073
45060
  if (!browser_fs["default"].existsSync(templateFilePath)) throw new Error(`HtmlRspackPlugin: could not load file \`${filename}\` from \`${context}\``);
45074
45061
  try {
45075
- const renderer = await (0, util_require.y)()(templateFilePath);
45062
+ const renderer = this.__internal_browser_require(templateFilePath);
45076
45063
  if (false === c.templateParameters) return await renderer({});
45077
45064
  return await renderer(generateRenderData(data));
45078
45065
  } catch (e) {
@@ -45157,11 +45144,11 @@ HtmlRspackPlugin.createHtmlTagObject = (tagName, attributes, innerHTML)=>({
45157
45144
  });
45158
45145
  HtmlRspackPlugin.getHooks = HtmlRspackPlugin.getCompilationHooks = getPluginHooks;
45159
45146
  HtmlRspackPlugin.version = 5;
45160
- const IgnorePlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.IgnorePlugin, (options)=>{
45147
+ const IgnorePlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.IgnorePlugin, (options)=>{
45161
45148
  validate(options, getIgnorePluginOptionsSchema);
45162
45149
  return options;
45163
45150
  });
45164
- const InferAsyncModulesPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.InferAsyncModulesPlugin, ()=>{}, "compilation");
45151
+ const InferAsyncModulesPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.InferAsyncModulesPlugin, ()=>{}, "compilation");
45165
45152
  function JavascriptModulesPlugin_define_property(obj, key, value) {
45166
45153
  if (key in obj) Object.defineProperty(obj, key, {
45167
45154
  value: value,
@@ -45173,9 +45160,9 @@ function JavascriptModulesPlugin_define_property(obj, key, value) {
45173
45160
  return obj;
45174
45161
  }
45175
45162
  const JavascriptModulesPlugin_compilationHooksMap = new WeakMap();
45176
- class JavascriptModulesPlugin extends RspackBuiltinPlugin {
45163
+ class JavascriptModulesPlugin extends builtin_plugin_base.Xj {
45177
45164
  raw() {
45178
- return createBuiltinPlugin(this.name, void 0);
45165
+ return (0, builtin_plugin_base.no)(this.name, void 0);
45179
45166
  }
45180
45167
  static getCompilationHooks(compilation) {
45181
45168
  checkCompilation(compilation);
@@ -45195,9 +45182,9 @@ class JavascriptModulesPlugin extends RspackBuiltinPlugin {
45195
45182
  super(...args), JavascriptModulesPlugin_define_property(this, "name", external_rspack_wasi_browser_js_.BuiltinPluginName.JavascriptModulesPlugin), JavascriptModulesPlugin_define_property(this, "affectedHooks", "compilation");
45196
45183
  }
45197
45184
  }
45198
- const JsLoaderRspackPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.JsLoaderRspackPlugin, (compiler)=>runLoaders.bind(null, compiler), "thisCompilation");
45199
- const JsonModulesPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.JsonModulesPlugin, ()=>{}, "compilation");
45200
- const LibManifestPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.LibManifestPlugin, (options)=>{
45185
+ const JsLoaderRspackPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.JsLoaderRspackPlugin, (compiler)=>runLoaders.bind(null, compiler), "thisCompilation");
45186
+ const JsonModulesPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.JsonModulesPlugin, ()=>{}, "compilation");
45187
+ const LibManifestPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.LibManifestPlugin, (options)=>{
45201
45188
  const { context, entryOnly, format, name, path, type } = options;
45202
45189
  return {
45203
45190
  context,
@@ -45208,7 +45195,7 @@ const LibManifestPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPl
45208
45195
  type
45209
45196
  };
45210
45197
  });
45211
- const LightningCssMinimizerRspackPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.LightningCssMinimizerRspackPlugin, (options)=>{
45198
+ const LightningCssMinimizerRspackPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.LightningCssMinimizerRspackPlugin, (options)=>{
45212
45199
  var _options_minimizerOptions, _options_minimizerOptions1, _options_minimizerOptions2;
45213
45200
  const { include, exclude, draft, nonStandard, pseudoClasses, drafts } = (null == options ? void 0 : options.minimizerOptions) ?? {};
45214
45201
  const targets = (null == options ? void 0 : null == (_options_minimizerOptions = options.minimizerOptions) ? void 0 : _options_minimizerOptions.targets) ?? "fully supports es6";
@@ -45238,14 +45225,8 @@ const LightningCssMinimizerRspackPlugin = base_create(external_rspack_wasi_brows
45238
45225
  }
45239
45226
  };
45240
45227
  });
45241
- const LimitChunkCountPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.LimitChunkCountPlugin, (options)=>options);
45242
- const BuiltinLazyCompilationPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.LazyCompilationPlugin, (module, cacheable, entries, imports, test)=>({
45243
- module,
45244
- cacheable,
45245
- imports,
45246
- entries,
45247
- test
45248
- }), "thisCompilation");
45228
+ const LimitChunkCountPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.LimitChunkCountPlugin, (options)=>options);
45229
+ var lazyCompilation = __webpack_require__("./src/builtin-plugin/lazy-compilation/lazyCompilation.ts");
45249
45230
  const LAZY_COMPILATION_PREFIX = "/lazy-compilation-using-";
45250
45231
  const getDefaultClient = (compiler)=>require.resolve(`../hot/lazy-compilation-${compiler.options.externalsPresets.node ? "node" : "web"}.js`);
45251
45232
  const noop = (_req, _res, next)=>{
@@ -45287,9 +45268,8 @@ const lazyCompilationMiddleware = (compiler)=>{
45287
45268
  const prefix = options.prefix || LAZY_COMPILATION_PREFIX;
45288
45269
  options.prefix = `${prefix}__${i++}`;
45289
45270
  const activeModules = new Set();
45290
- const filesByKey = new Map();
45291
- middlewareByCompiler.set(options.prefix, lazyCompilationMiddlewareInternal(compiler, activeModules, filesByKey, options.prefix));
45292
- applyPlugin(c, options, activeModules, filesByKey);
45271
+ middlewareByCompiler.set(options.prefix, lazyCompilationMiddlewareInternal(compiler, activeModules, options.prefix));
45272
+ applyPlugin(c, options, activeModules);
45293
45273
  }
45294
45274
  const keys = [
45295
45275
  ...middlewareByCompiler.keys()
@@ -45310,34 +45290,28 @@ const lazyCompilationMiddleware = (compiler)=>{
45310
45290
  }
45311
45291
  if (!compiler.options.lazyCompilation && !compiler.options.experiments.lazyCompilation) return noop;
45312
45292
  const activeModules = new Set();
45313
- const filesByKey = new Map();
45314
45293
  const options = {
45315
45294
  ...compiler.options.experiments.lazyCompilation,
45316
45295
  ...compiler.options.lazyCompilation
45317
45296
  };
45318
- applyPlugin(compiler, options, activeModules, filesByKey);
45297
+ applyPlugin(compiler, options, activeModules);
45319
45298
  const lazyCompilationPrefix = options.prefix || LAZY_COMPILATION_PREFIX;
45320
- return lazyCompilationMiddlewareInternal(compiler, activeModules, filesByKey, lazyCompilationPrefix);
45299
+ return lazyCompilationMiddlewareInternal(compiler, activeModules, lazyCompilationPrefix);
45321
45300
  };
45322
- function applyPlugin(compiler, options, activeModules, filesByKey) {
45323
- const plugin = new BuiltinLazyCompilationPlugin(({ module, path })=>{
45324
- const data = `${encodeURIComponent(module.replace(/\\/g, "/").replace(/@/g, "_"))}`;
45325
- filesByKey.set(data, path);
45326
- const active = activeModules.has(data);
45327
- return {
45328
- client: `${options.client || getDefaultClient(compiler)}?${encodeURIComponent(getFullServerUrl(options))}`,
45329
- data,
45330
- active
45331
- };
45332
- }, options.cacheable ?? true, options.entries ?? true, options.imports ?? true, options.test);
45301
+ function applyPlugin(compiler, options, activeModules) {
45302
+ const plugin = new lazyCompilation.a(()=>{
45303
+ const res = new Set(activeModules);
45304
+ activeModules.clear();
45305
+ return res;
45306
+ }, options.entries ?? true, options.imports ?? true, `${options.client || getDefaultClient(compiler)}?${encodeURIComponent(getFullServerUrl(options))}`, options.test);
45333
45307
  plugin.apply(compiler);
45334
45308
  }
45335
- const lazyCompilationMiddlewareInternal = (compiler, activeModules, filesByKey, lazyCompilationPrefix)=>{
45309
+ const lazyCompilationMiddlewareInternal = (compiler, activeModules, lazyCompilationPrefix)=>{
45336
45310
  const logger = compiler.getInfrastructureLogger("LazyCompilation");
45337
45311
  return (req, res, next)=>{
45338
45312
  var _req_url;
45339
45313
  if (!(null == (_req_url = req.url) ? void 0 : _req_url.startsWith(lazyCompilationPrefix))) return null == next ? void 0 : next();
45340
- const modules = req.url.slice(lazyCompilationPrefix.length).split("@");
45314
+ const modules = req.url.slice(lazyCompilationPrefix.length).split("@").map(decodeURIComponent);
45341
45315
  req.socket.setNoDelay(true);
45342
45316
  res.setHeader("content-type", "text/event-stream");
45343
45317
  res.writeHead(200);
@@ -45351,14 +45325,7 @@ const lazyCompilationMiddlewareInternal = (compiler, activeModules, filesByKey,
45351
45325
  moduleActivated.push(key);
45352
45326
  }
45353
45327
  }
45354
- if (moduleActivated.length && compiler.watching) {
45355
- const rebuiltModules = new Set(moduleActivated.map((key)=>{
45356
- const filePath = filesByKey.get(key);
45357
- if (!filePath) logger.warn(`Cannot find correct file path for module ${key}`);
45358
- return filePath;
45359
- }).filter(Boolean));
45360
- if (rebuiltModules.size) compiler.watching.invalidateWithChangesAndRemovals(rebuiltModules);
45361
- }
45328
+ if (moduleActivated.length && compiler.watching) compiler.watching.invalidate();
45362
45329
  };
45363
45330
  };
45364
45331
  function MangleExportsPlugin_define_property(obj, key, value) {
@@ -45371,16 +45338,16 @@ function MangleExportsPlugin_define_property(obj, key, value) {
45371
45338
  else obj[key] = value;
45372
45339
  return obj;
45373
45340
  }
45374
- class MangleExportsPlugin extends RspackBuiltinPlugin {
45341
+ class MangleExportsPlugin extends builtin_plugin_base.Xj {
45375
45342
  raw(compiler) {
45376
- return createBuiltinPlugin(this.name, this.deterministic);
45343
+ return (0, builtin_plugin_base.no)(this.name, this.deterministic);
45377
45344
  }
45378
45345
  constructor(deterministic){
45379
45346
  super(), MangleExportsPlugin_define_property(this, "deterministic", void 0), MangleExportsPlugin_define_property(this, "name", void 0), MangleExportsPlugin_define_property(this, "affectedHooks", void 0), this.deterministic = deterministic, this.name = external_rspack_wasi_browser_js_.BuiltinPluginName.MangleExportsPlugin, this.affectedHooks = "compilation";
45380
45347
  }
45381
45348
  }
45382
- const MergeDuplicateChunksPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.MergeDuplicateChunksPlugin, ()=>{});
45383
- const ModuleChunkFormatPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.ModuleChunkFormatPlugin, ()=>{});
45349
+ const MergeDuplicateChunksPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.MergeDuplicateChunksPlugin, ()=>{});
45350
+ const ModuleChunkFormatPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.ModuleChunkFormatPlugin, ()=>{});
45384
45351
  function ModuleConcatenationPlugin_define_property(obj, key, value) {
45385
45352
  if (key in obj) Object.defineProperty(obj, key, {
45386
45353
  value: value,
@@ -45391,17 +45358,17 @@ function ModuleConcatenationPlugin_define_property(obj, key, value) {
45391
45358
  else obj[key] = value;
45392
45359
  return obj;
45393
45360
  }
45394
- class ModuleConcatenationPlugin extends RspackBuiltinPlugin {
45361
+ class ModuleConcatenationPlugin extends builtin_plugin_base.Xj {
45395
45362
  raw(compiler) {
45396
- return createBuiltinPlugin(this.name, void 0);
45363
+ return (0, builtin_plugin_base.no)(this.name, void 0);
45397
45364
  }
45398
45365
  constructor(...args){
45399
45366
  super(...args), ModuleConcatenationPlugin_define_property(this, "name", external_rspack_wasi_browser_js_.BuiltinPluginName.ModuleConcatenationPlugin), ModuleConcatenationPlugin_define_property(this, "affectedHooks", "compilation");
45400
45367
  }
45401
45368
  }
45402
- const ModuleInfoHeaderPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.ModuleInfoHeaderPlugin, (verbose)=>verbose, "compilation");
45403
- const NamedChunkIdsPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.NamedChunkIdsPlugin, ()=>{}, "compilation");
45404
- const NamedModuleIdsPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.NamedModuleIdsPlugin, ()=>{}, "compilation");
45369
+ const ModuleInfoHeaderPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.ModuleInfoHeaderPlugin, (verbose)=>verbose, "compilation");
45370
+ const NamedChunkIdsPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.NamedChunkIdsPlugin, ()=>{}, "compilation");
45371
+ const NamedModuleIdsPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.NamedModuleIdsPlugin, ()=>{}, "compilation");
45405
45372
  function NaturalChunkIdsPlugin_define_property(obj, key, value) {
45406
45373
  if (key in obj) Object.defineProperty(obj, key, {
45407
45374
  value: value,
@@ -45412,9 +45379,9 @@ function NaturalChunkIdsPlugin_define_property(obj, key, value) {
45412
45379
  else obj[key] = value;
45413
45380
  return obj;
45414
45381
  }
45415
- class NaturalChunkIdsPlugin extends RspackBuiltinPlugin {
45382
+ class NaturalChunkIdsPlugin extends builtin_plugin_base.Xj {
45416
45383
  raw(compiler) {
45417
- return createBuiltinPlugin(this.name, void 0);
45384
+ return (0, builtin_plugin_base.no)(this.name, void 0);
45418
45385
  }
45419
45386
  constructor(...args){
45420
45387
  super(...args), NaturalChunkIdsPlugin_define_property(this, "name", external_rspack_wasi_browser_js_.BuiltinPluginName.NaturalChunkIdsPlugin), NaturalChunkIdsPlugin_define_property(this, "affectedHooks", "compilation");
@@ -45430,27 +45397,27 @@ function NaturalModuleIdsPlugin_define_property(obj, key, value) {
45430
45397
  else obj[key] = value;
45431
45398
  return obj;
45432
45399
  }
45433
- class NaturalModuleIdsPlugin extends RspackBuiltinPlugin {
45400
+ class NaturalModuleIdsPlugin extends builtin_plugin_base.Xj {
45434
45401
  raw(compiler) {
45435
- return createBuiltinPlugin(this.name, void 0);
45402
+ return (0, builtin_plugin_base.no)(this.name, void 0);
45436
45403
  }
45437
45404
  constructor(...args){
45438
45405
  super(...args), NaturalModuleIdsPlugin_define_property(this, "name", external_rspack_wasi_browser_js_.BuiltinPluginName.NaturalModuleIdsPlugin), NaturalModuleIdsPlugin_define_property(this, "affectedHooks", "compilation");
45439
45406
  }
45440
45407
  }
45441
- const NodeTargetPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.NodeTargetPlugin, ()=>void 0);
45442
- const NoEmitOnErrorsPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.NoEmitOnErrorsPlugin, ()=>void 0);
45443
- const NormalModuleReplacementPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.NormalModuleReplacementPlugin, (resourceRegExp, newResource)=>({
45408
+ const NodeTargetPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.NodeTargetPlugin, ()=>void 0);
45409
+ const NoEmitOnErrorsPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.NoEmitOnErrorsPlugin, ()=>void 0);
45410
+ const NormalModuleReplacementPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.NormalModuleReplacementPlugin, (resourceRegExp, newResource)=>({
45444
45411
  resourceRegExp,
45445
45412
  newResource: "function" == typeof newResource ? (data)=>{
45446
45413
  newResource(data);
45447
45414
  return data;
45448
45415
  } : newResource
45449
45416
  }));
45450
- const OccurrenceChunkIdsPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.OccurrenceChunkIdsPlugin, (options)=>({
45417
+ const OccurrenceChunkIdsPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.OccurrenceChunkIdsPlugin, (options)=>({
45451
45418
  ...options
45452
45419
  }), "compilation");
45453
- const ProgressPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.ProgressPlugin, (progress = {})=>{
45420
+ const ProgressPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.ProgressPlugin, (progress = {})=>{
45454
45421
  if ("function" == typeof progress) return {
45455
45422
  handler: (percentage, msg, items)=>{
45456
45423
  progress(percentage, msg, ...items);
@@ -45458,7 +45425,7 @@ const ProgressPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPlugi
45458
45425
  };
45459
45426
  return progress;
45460
45427
  });
45461
- const ProvidePlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.ProvidePlugin, (provide)=>{
45428
+ const ProvidePlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.ProvidePlugin, (provide)=>{
45462
45429
  const entries = Object.entries(provide).map(([key, value])=>{
45463
45430
  if ("string" == typeof value) value = [
45464
45431
  value
@@ -45470,10 +45437,10 @@ const ProvidePlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPlugin
45470
45437
  });
45471
45438
  return Object.fromEntries(entries);
45472
45439
  }, "compilation");
45473
- const RealContentHashPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.RealContentHashPlugin, ()=>{}, "compilation");
45474
- const RemoveDuplicateModulesPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.RemoveDuplicateModulesPlugin, ()=>({}));
45475
- const RemoveEmptyChunksPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.RemoveEmptyChunksPlugin, ()=>{}, "compilation");
45476
- const RsdoctorPluginImpl = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.RsdoctorPlugin, function(c = {
45440
+ const RealContentHashPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.RealContentHashPlugin, ()=>{}, "compilation");
45441
+ const RemoveDuplicateModulesPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.RemoveDuplicateModulesPlugin, ()=>({}));
45442
+ const RemoveEmptyChunksPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.RemoveEmptyChunksPlugin, ()=>{}, "compilation");
45443
+ const RsdoctorPluginImpl = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.RsdoctorPlugin, function(c = {
45477
45444
  moduleGraphFeatures: true,
45478
45445
  chunkGraphFeatures: true
45479
45446
  }) {
@@ -45548,10 +45515,10 @@ const createRsdoctorPluginHooksRegisters = (getCompiler, createTap, createMapTap
45548
45515
  };
45549
45516
  })
45550
45517
  });
45551
- const RslibPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.RslibPlugin, (rslib)=>rslib);
45552
- const RstestPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.RstestPlugin, (rstest)=>rstest);
45553
- const RuntimeChunkPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.RuntimeChunkPlugin, (options)=>options, "thisCompilation");
45554
- const RuntimePluginImpl = base_create(external_rspack_wasi_browser_js_["default"].BuiltinPluginName.RuntimePlugin, ()=>{}, "compilation");
45518
+ const RslibPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.RslibPlugin, (rslib)=>rslib);
45519
+ const RstestPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.RstestPlugin, (rstest)=>rstest);
45520
+ const RuntimeChunkPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.RuntimeChunkPlugin, (options)=>options, "thisCompilation");
45521
+ const RuntimePluginImpl = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_["default"].BuiltinPluginName.RuntimePlugin, ()=>{}, "compilation");
45555
45522
  const RuntimePlugin = RuntimePluginImpl;
45556
45523
  const RuntimePlugin_compilationHooksMap = new WeakMap();
45557
45524
  RuntimePlugin.getHooks = RuntimePlugin.getCompilationHooks = (compilation)=>{
@@ -45599,15 +45566,15 @@ const createRuntimePluginHooksRegisters = (getCompiler, createTap, createMapTap)
45599
45566
  };
45600
45567
  })
45601
45568
  });
45602
- const SideEffectsFlagPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.SideEffectsFlagPlugin, ()=>{}, "compilation");
45603
- const SizeLimitsPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.SizeLimitsPlugin, (options)=>{
45569
+ const SideEffectsFlagPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.SideEffectsFlagPlugin, ()=>{}, "compilation");
45570
+ const SizeLimitsPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.SizeLimitsPlugin, (options)=>{
45604
45571
  const hints = false === options.hints ? void 0 : options.hints;
45605
45572
  return {
45606
45573
  ...options,
45607
45574
  hints
45608
45575
  };
45609
45576
  });
45610
- const SourceMapDevToolPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.SourceMapDevToolPlugin, (options)=>options, "compilation");
45577
+ const SourceMapDevToolPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.SourceMapDevToolPlugin, (options)=>options, "compilation");
45611
45578
  class JsSplitChunkSizes {
45612
45579
  static __to_binding(sizes) {
45613
45580
  if ("number" == typeof sizes) return sizes;
@@ -45630,11 +45597,11 @@ function SplitChunksPlugin_define_property(obj, key, value) {
45630
45597
  else obj[key] = value;
45631
45598
  return obj;
45632
45599
  }
45633
- class SplitChunksPlugin extends RspackBuiltinPlugin {
45600
+ class SplitChunksPlugin extends builtin_plugin_base.Xj {
45634
45601
  raw(compiler) {
45635
45602
  const rawOptions = toRawSplitChunksOptions(this.options, compiler);
45636
45603
  assert_default()(void 0 !== rawOptions);
45637
- return createBuiltinPlugin(this.name, rawOptions);
45604
+ return (0, builtin_plugin_base.no)(this.name, rawOptions);
45638
45605
  }
45639
45606
  constructor(options){
45640
45607
  super(), SplitChunksPlugin_define_property(this, "options", void 0), SplitChunksPlugin_define_property(this, "name", void 0), SplitChunksPlugin_define_property(this, "affectedHooks", void 0), this.options = options, this.name = external_rspack_wasi_browser_js_.BuiltinPluginName.SplitChunksPlugin, this.affectedHooks = "thisCompilation";
@@ -45711,7 +45678,7 @@ function SubresourceIntegrityPlugin_define_property(obj, key, value) {
45711
45678
  }
45712
45679
  const SubresourceIntegrityPlugin_PLUGIN_NAME = "SubresourceIntegrityPlugin";
45713
45680
  const NATIVE_HTML_PLUGIN = "HtmlRspackPlugin";
45714
- const NativeSubresourceIntegrityPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.SubresourceIntegrityPlugin, function(options) {
45681
+ const NativeSubresourceIntegrityPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.SubresourceIntegrityPlugin, function(options) {
45715
45682
  let htmlPlugin = "Disabled";
45716
45683
  if (options.htmlPlugin === NATIVE_HTML_PLUGIN) htmlPlugin = "Native";
45717
45684
  else if ("string" == typeof options.htmlPlugin) htmlPlugin = "JavaScript";
@@ -45797,9 +45764,12 @@ class SubresourceIntegrityPlugin extends NativeSubresourceIntegrityPlugin {
45797
45764
  });
45798
45765
  });
45799
45766
  }
45800
- (0, util_require.y)()(this.options.htmlPlugin).then(bindingHtmlHooks).catch((e)=>{
45767
+ try {
45768
+ const htmlPlugin = compiler.__internal_browser_require(this.options.htmlPlugin);
45769
+ bindingHtmlHooks(htmlPlugin);
45770
+ } catch (e) {
45801
45771
  if (!isErrorWithCode(e) || "MODULE_NOT_FOUND" !== e.code) throw e;
45802
- });
45772
+ }
45803
45773
  }
45804
45774
  }
45805
45775
  constructor(options = {}){
@@ -45894,7 +45864,7 @@ function getRawExtractCommentsOptions(extractComments) {
45894
45864
  return res;
45895
45865
  }
45896
45866
  }
45897
- const SwcJsMinimizerRspackPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.SwcJsMinimizerRspackPlugin, (options)=>{
45867
+ const SwcJsMinimizerRspackPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.SwcJsMinimizerRspackPlugin, (options)=>{
45898
45868
  var _options_minimizerOptions, _options_minimizerOptions1, _options_minimizerOptions2, _options_minimizerOptions3, _options_minimizerOptions4, _options_minimizerOptions5;
45899
45869
  let compress = (null == options ? void 0 : null == (_options_minimizerOptions = options.minimizerOptions) ? void 0 : _options_minimizerOptions.compress) ?? true;
45900
45870
  const mangle = (null == options ? void 0 : null == (_options_minimizerOptions1 = options.minimizerOptions) ? void 0 : _options_minimizerOptions1.mangle) ?? true;
@@ -45925,7 +45895,7 @@ const SwcJsMinimizerRspackPlugin = base_create(external_rspack_wasi_browser_js_.
45925
45895
  }
45926
45896
  };
45927
45897
  }, "compilation");
45928
- const WarnCaseSensitiveModulesPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.WarnCaseSensitiveModulesPlugin, ()=>{}, "compilation");
45898
+ const WarnCaseSensitiveModulesPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.WarnCaseSensitiveModulesPlugin, ()=>{}, "compilation");
45929
45899
  function WebWorkerTemplatePlugin_define_property(obj, key, value) {
45930
45900
  if (key in obj) Object.defineProperty(obj, key, {
45931
45901
  value: value,
@@ -45936,10 +45906,10 @@ function WebWorkerTemplatePlugin_define_property(obj, key, value) {
45936
45906
  else obj[key] = value;
45937
45907
  return obj;
45938
45908
  }
45939
- class WebWorkerTemplatePlugin extends RspackBuiltinPlugin {
45909
+ class WebWorkerTemplatePlugin extends builtin_plugin_base.Xj {
45940
45910
  raw(compiler) {
45941
45911
  compiler.options.output.chunkLoading = "import-scripts";
45942
- return createBuiltinPlugin(this.name, void 0);
45912
+ return (0, builtin_plugin_base.no)(this.name, void 0);
45943
45913
  }
45944
45914
  constructor(...args){
45945
45915
  super(...args), WebWorkerTemplatePlugin_define_property(this, "name", external_rspack_wasi_browser_js_.BuiltinPluginName.WebWorkerTemplatePlugin);
@@ -45955,11 +45925,11 @@ function WorkerPlugin_define_property(obj, key, value) {
45955
45925
  else obj[key] = value;
45956
45926
  return obj;
45957
45927
  }
45958
- class WorkerPlugin extends RspackBuiltinPlugin {
45928
+ class WorkerPlugin extends builtin_plugin_base.Xj {
45959
45929
  raw(compiler) {
45960
45930
  if (this.chunkLoading) new EnableChunkLoadingPlugin(this.chunkLoading).apply(compiler);
45961
45931
  if (this.wasmLoading) new EnableWasmLoadingPlugin(this.wasmLoading).apply(compiler);
45962
- return createBuiltinPlugin(this.name, void 0);
45932
+ return (0, builtin_plugin_base.no)(this.name, void 0);
45963
45933
  }
45964
45934
  constructor(chunkLoading, wasmLoading, module, workerPublicPath){
45965
45935
  super(), WorkerPlugin_define_property(this, "chunkLoading", void 0), WorkerPlugin_define_property(this, "wasmLoading", void 0), WorkerPlugin_define_property(this, "module", void 0), WorkerPlugin_define_property(this, "workerPublicPath", void 0), WorkerPlugin_define_property(this, "name", void 0), this.chunkLoading = chunkLoading, this.wasmLoading = wasmLoading, this.module = module, this.workerPublicPath = workerPublicPath, this.name = external_rspack_wasi_browser_js_.BuiltinPluginName.WorkerPlugin;
@@ -47101,7 +47071,7 @@ const applybundlerInfoDefaults = (rspackFuture, library)=>{
47101
47071
  if ("object" == typeof rspackFuture) {
47102
47072
  D(rspackFuture, "bundlerInfo", {});
47103
47073
  if ("object" == typeof rspackFuture.bundlerInfo) {
47104
- D(rspackFuture.bundlerInfo, "version", "1.5.0-canary-efb61069-20250820113456");
47074
+ D(rspackFuture.bundlerInfo, "version", "1.5.1-canary-7c68c987-20250828115508");
47105
47075
  D(rspackFuture.bundlerInfo, "bundler", "rspack");
47106
47076
  D(rspackFuture.bundlerInfo, "force", !library);
47107
47077
  }
@@ -49970,7 +49940,7 @@ const toJsWatcherIgnored = (ignored)=>{
49970
49940
  if (Array.isArray(ignored) || "string" == typeof ignored || ignored instanceof RegExp) return ignored;
49971
49941
  if ("function" == typeof ignored) throw new Error("NativeWatcher does not support using a function for the 'ignored' option");
49972
49942
  };
49973
- var NativeWatchFileSystem_inner = /*#__PURE__*/ new WeakMap(), _inputFileSystem = /*#__PURE__*/ new WeakMap();
49943
+ var NativeWatchFileSystem_inner = /*#__PURE__*/ new WeakMap(), _isFirstWatch = /*#__PURE__*/ new WeakMap(), _inputFileSystem = /*#__PURE__*/ new WeakMap();
49974
49944
  class NativeWatchFileSystem {
49975
49945
  watch(files, directories, missing, _startTime, options, callback, callbackUndelayed) {
49976
49946
  if ((!files.added || "function" != typeof files.added[Symbol.iterator]) && (!files.removed || "function" != typeof files.removed[Symbol.iterator])) throw new Error("Invalid arguments: 'files'");
@@ -49979,16 +49949,7 @@ class NativeWatchFileSystem {
49979
49949
  if ("object" != typeof options) throw new Error("Invalid arguments: 'options'");
49980
49950
  if ("function" != typeof callbackUndelayed && callbackUndelayed) throw new Error("Invalid arguments: 'callbackUndelayed'");
49981
49951
  const nativeWatcher = this.getNativeWatcher(options);
49982
- nativeWatcher.watch([
49983
- Array.from(files.added),
49984
- Array.from(files.removed)
49985
- ], [
49986
- Array.from(directories.added),
49987
- Array.from(directories.removed)
49988
- ], [
49989
- Array.from(missing.added),
49990
- Array.from(missing.removed)
49991
- ], (err, result)=>{
49952
+ nativeWatcher.watch(this.formatWatchDependencies(files), this.formatWatchDependencies(directories), this.formatWatchDependencies(missing), (err, result)=>{
49992
49953
  var _class_private_field_get1;
49993
49954
  if (err) return void callback(err, new Map(), new Map(), new Set(), new Set());
49994
49955
  nativeWatcher.pause();
@@ -50009,6 +49970,7 @@ class NativeWatchFileSystem {
50009
49970
  }, (fileName)=>{
50010
49971
  callbackUndelayed(fileName, Date.now());
50011
49972
  });
49973
+ NativeWatchFileSystem_class_private_field_set(this, _isFirstWatch, false);
50012
49974
  return {
50013
49975
  close: ()=>{
50014
49976
  nativeWatcher.close().then(()=>{
@@ -50046,11 +50008,25 @@ class NativeWatchFileSystem {
50046
50008
  var _class_private_field_get1;
50047
50009
  null == (_class_private_field_get1 = NativeWatchFileSystem_class_private_field_get(this, NativeWatchFileSystem_inner)) || _class_private_field_get1.triggerEvent(kind, path);
50048
50010
  }
50011
+ formatWatchDependencies(dependencies) {
50012
+ if (NativeWatchFileSystem_class_private_field_get(this, _isFirstWatch)) return [
50013
+ Array.from(dependencies),
50014
+ []
50015
+ ];
50016
+ return [
50017
+ Array.from(dependencies.added ?? []),
50018
+ Array.from(dependencies.removed ?? [])
50019
+ ];
50020
+ }
50049
50021
  constructor(inputFileSystem){
50050
50022
  NativeWatchFileSystem_class_private_field_init(this, NativeWatchFileSystem_inner, {
50051
50023
  writable: true,
50052
50024
  value: void 0
50053
50025
  });
50026
+ NativeWatchFileSystem_class_private_field_init(this, _isFirstWatch, {
50027
+ writable: true,
50028
+ value: true
50029
+ });
50054
50030
  NativeWatchFileSystem_class_private_field_init(this, _inputFileSystem, {
50055
50031
  writable: true,
50056
50032
  value: void 0
@@ -50723,7 +50699,7 @@ class Compiler {
50723
50699
  ]);
50724
50700
  for(const hookName in this.hooks){
50725
50701
  const name = hookName;
50726
- if (canInherentFromParent(name)) {
50702
+ if ((0, builtin_plugin_base.Gp)(name)) {
50727
50703
  if (childCompiler.hooks[name]) childCompiler.hooks[name].taps = this.hooks[name].taps.slice();
50728
50704
  }
50729
50705
  }
@@ -50880,6 +50856,7 @@ class Compiler {
50880
50856
  Compiler_define_property(this, "cache", void 0);
50881
50857
  Compiler_define_property(this, "compilerPath", void 0);
50882
50858
  Compiler_define_property(this, "options", void 0);
50859
+ Compiler_define_property(this, "__internal_browser_require", void 0);
50883
50860
  Compiler_class_private_field_set(this, Compiler_initial, true);
50884
50861
  Compiler_class_private_field_set(this, _builtinPlugins, []);
50885
50862
  Compiler_class_private_field_set(this, _nonSkippableRegisters, []);
@@ -50988,6 +50965,9 @@ class Compiler {
50988
50965
  this.running = false;
50989
50966
  this.idle = false;
50990
50967
  this.watchMode = false;
50968
+ this.__internal_browser_require = ()=>{
50969
+ throw new Error("Cannot execute user defined code in browser without `BrowserRequirePlugin`");
50970
+ };
50991
50971
  this.resolverFactory = new ResolverFactory(options.resolve.pnp ?? getPnpDefault(), options.resolve, options.resolveLoader);
50992
50972
  new JsLoaderRspackPlugin(this).apply(this);
50993
50973
  new ExecuteModulePlugin().apply(this);
@@ -51186,7 +51166,7 @@ class MultiStats {
51186
51166
  return obj;
51187
51167
  });
51188
51168
  if (childOptions.version) {
51189
- obj.rspackVersion = "1.5.0-canary-efb61069-20250820113456";
51169
+ obj.rspackVersion = "1.5.1-canary-7c68c987-20250828115508";
51190
51170
  obj.version = "5.75.0";
51191
51171
  }
51192
51172
  if (childOptions.hash) obj.hash = obj.children.map((j)=>j.hash).join("");
@@ -51306,7 +51286,7 @@ function MultiWatching_define_property(obj, key, value) {
51306
51286
  else obj[key] = value;
51307
51287
  return obj;
51308
51288
  }
51309
- class MultiWatching_MultiWatching {
51289
+ class MultiWatching {
51310
51290
  invalidate(callback) {
51311
51291
  if (callback) asyncLib.each(this.watchings, (watching, callback)=>watching.invalidate(callback), callback);
51312
51292
  else for (const watching of this.watchings)watching.invalidate();
@@ -51339,7 +51319,7 @@ class MultiWatching_MultiWatching {
51339
51319
  this.compiler = compiler;
51340
51320
  }
51341
51321
  }
51342
- const MultiWatching = MultiWatching_MultiWatching;
51322
+ const src_MultiWatching = MultiWatching;
51343
51323
  function ArrayQueue_define_property(obj, key, value) {
51344
51324
  if (key in obj) Object.defineProperty(obj, key, {
51345
51325
  value: value,
@@ -51516,10 +51496,10 @@ class MultiCompiler {
51516
51496
  if (compiler.watching !== watching) return;
51517
51497
  if (!watching.running) watching.invalidate();
51518
51498
  }, handler);
51519
- this.watching = new MultiWatching(watchings, this);
51499
+ this.watching = new src_MultiWatching(watchings, this);
51520
51500
  return this.watching;
51521
51501
  }
51522
- this.watching = new MultiWatching([], this);
51502
+ this.watching = new src_MultiWatching([], this);
51523
51503
  return this.watching;
51524
51504
  }
51525
51505
  run(callback, options) {
@@ -52496,7 +52476,7 @@ const SIMPLE_EXTRACTORS = {
52496
52476
  },
52497
52477
  version: (object)=>{
52498
52478
  object.version = "5.75.0";
52499
- object.rspackVersion = "1.5.0-canary-efb61069-20250820113456";
52479
+ object.rspackVersion = "1.5.1-canary-7c68c987-20250828115508";
52500
52480
  },
52501
52481
  env: (object, _compilation, _context, { _env })=>{
52502
52482
  object.env = _env;
@@ -54107,14 +54087,14 @@ class RspackOptionsApply {
54107
54087
  compiler.outputFileSystem = browser_fs["default"];
54108
54088
  if (options.externals) {
54109
54089
  assert_default()(options.externalsType, "options.externalsType should have value after `applyRspackOptionsDefaults`");
54110
- new ExternalsPlugin(options.externalsType, options.externals).apply(compiler);
54090
+ new ExternalsPlugin(options.externalsType, options.externals, false).apply(compiler);
54111
54091
  }
54112
54092
  if (options.externalsPresets.node) new NodeTargetPlugin().apply(compiler);
54113
54093
  if (options.externalsPresets.electronMain) new ElectronTargetPlugin("main").apply(compiler);
54114
54094
  if (options.externalsPresets.electronPreload) new ElectronTargetPlugin("preload").apply(compiler);
54115
54095
  if (options.externalsPresets.electronRenderer) new ElectronTargetPlugin("renderer").apply(compiler);
54116
54096
  if (options.externalsPresets.electron && !options.externalsPresets.electronMain && !options.externalsPresets.electronPreload && !options.externalsPresets.electronRenderer) new ElectronTargetPlugin().apply(compiler);
54117
- if (options.externalsPresets.nwjs) new ExternalsPlugin("node-commonjs", "nw.gui").apply(compiler);
54097
+ if (options.externalsPresets.nwjs) new ExternalsPlugin("node-commonjs", "nw.gui", false).apply(compiler);
54118
54098
  if (options.externalsPresets.web || options.externalsPresets.webAsync || options.externalsPresets.node && options.experiments.css) new HttpExternalsRspackPlugin(!!options.experiments.css, !!options.externalsPresets.webAsync).apply(compiler);
54119
54099
  new ChunkPrefetchPreloadPlugin().apply(compiler);
54120
54100
  if (options.output.pathinfo) new ModuleInfoHeaderPlugin("verbose" === options.output.pathinfo).apply(compiler);
@@ -54336,7 +54316,7 @@ const matchObject = (obj, str)=>{
54336
54316
  }
54337
54317
  return true;
54338
54318
  };
54339
- const FlagAllModulesAsUsedPlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.FlagAllModulesAsUsedPlugin, (explanation)=>({
54319
+ const FlagAllModulesAsUsedPlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.FlagAllModulesAsUsedPlugin, (explanation)=>({
54340
54320
  explanation
54341
54321
  }));
54342
54322
  function DllPlugin_define_property(obj, key, value) {
@@ -55216,6 +55196,7 @@ const getZodSwcLoaderOptionsSchema = memoize(()=>{
55216
55196
  "2022-03"
55217
55197
  ]),
55218
55198
  treatConstEnumAsEnum: schemas_boolean(),
55199
+ tsEnumIsMutable: schemas_boolean(),
55219
55200
  useDefineForClassFields: schemas_boolean(),
55220
55201
  verbatimModuleSyntax: schemas_boolean()
55221
55202
  }).partial();
@@ -56410,7 +56391,7 @@ const getRspackOptionsSchema = memoize(()=>{
56410
56391
  }).partial().check(externalUmdChecker);
56411
56392
  return rspackOptions;
56412
56393
  });
56413
- const ModuleFederationRuntimePlugin = base_create(external_rspack_wasi_browser_js_.BuiltinPluginName.ModuleFederationRuntimePlugin, (options = {})=>options);
56394
+ const ModuleFederationRuntimePlugin = (0, builtin_plugin_base.vt)(external_rspack_wasi_browser_js_.BuiltinPluginName.ModuleFederationRuntimePlugin, (options = {})=>options);
56414
56395
  const options_process = (options, normalizeSimple, normalizeOptions, fn)=>{
56415
56396
  const array = (items)=>{
56416
56397
  for (const item of items)if ("string" == typeof item) fn(item, normalizeSimple(item, item));
@@ -56569,11 +56550,7 @@ function getDefaultEntryRuntime(paths, options, compiler) {
56569
56550
  `const __module_federation_remote_infos__ = ${JSON.stringify(remoteInfos)}`,
56570
56551
  `const __module_federation_container_name__ = ${JSON.stringify(options.name ?? compiler.options.output.uniqueName)}`,
56571
56552
  `const __module_federation_share_strategy__ = ${JSON.stringify(options.shareStrategy ?? "version-first")}`,
56572
- compiler.webpack.Template.getFunctionContent(__webpack_require__(Object(function() {
56573
- var e = new Error("Cannot find module './moduleFederationDefaultRuntime.js'");
56574
- e.code = 'MODULE_NOT_FOUND';
56575
- throw e;
56576
- }())))
56553
+ compiler.webpack.Template.getFunctionContent(compiler.__internal_browser_require("@rspack/browser/moduleFederationDefaultRuntime.js"))
56577
56554
  ].join(";");
56578
56555
  return `@module-federation/runtime/rspack.js!=!data:text/javascript,${content}`;
56579
56556
  }
@@ -56594,11 +56571,11 @@ function isSingleton(compiler) {
56594
56571
  function setSingleton(compiler) {
56595
56572
  compilerSet.add(compiler);
56596
56573
  }
56597
- class ShareRuntimePlugin extends RspackBuiltinPlugin {
56574
+ class ShareRuntimePlugin extends builtin_plugin_base.Xj {
56598
56575
  raw(compiler) {
56599
56576
  if (isSingleton(compiler)) return;
56600
56577
  setSingleton(compiler);
56601
- return createBuiltinPlugin(this.name, this.enhanced);
56578
+ return (0, builtin_plugin_base.no)(this.name, this.enhanced);
56602
56579
  }
56603
56580
  constructor(enhanced = false){
56604
56581
  super(), ShareRuntimePlugin_define_property(this, "enhanced", void 0), ShareRuntimePlugin_define_property(this, "name", void 0), this.enhanced = enhanced, this.name = external_rspack_wasi_browser_js_.BuiltinPluginName.ShareRuntimePlugin;
@@ -56618,7 +56595,7 @@ function ConsumeSharedPlugin_define_property(obj, key, value) {
56618
56595
  else obj[key] = value;
56619
56596
  return obj;
56620
56597
  }
56621
- class ConsumeSharedPlugin extends RspackBuiltinPlugin {
56598
+ class ConsumeSharedPlugin extends builtin_plugin_base.Xj {
56622
56599
  raw(compiler) {
56623
56600
  new ShareRuntimePlugin(this._options.enhanced).apply(compiler);
56624
56601
  const rawOptions = {
@@ -56628,7 +56605,7 @@ class ConsumeSharedPlugin extends RspackBuiltinPlugin {
56628
56605
  })),
56629
56606
  enhanced: this._options.enhanced
56630
56607
  };
56631
- return createBuiltinPlugin(this.name, rawOptions);
56608
+ return (0, builtin_plugin_base.no)(this.name, rawOptions);
56632
56609
  }
56633
56610
  constructor(options){
56634
56611
  super(), ConsumeSharedPlugin_define_property(this, "name", external_rspack_wasi_browser_js_.BuiltinPluginName.ConsumeSharedPlugin), ConsumeSharedPlugin_define_property(this, "_options", void 0);
@@ -56679,14 +56656,14 @@ function ProvideSharedPlugin_define_property(obj, key, value) {
56679
56656
  else obj[key] = value;
56680
56657
  return obj;
56681
56658
  }
56682
- class ProvideSharedPlugin extends RspackBuiltinPlugin {
56659
+ class ProvideSharedPlugin extends builtin_plugin_base.Xj {
56683
56660
  raw(compiler) {
56684
56661
  new ShareRuntimePlugin(this._enhanced ?? false).apply(compiler);
56685
56662
  const rawOptions = this._provides.map(([key, v])=>({
56686
56663
  key,
56687
56664
  ...v
56688
56665
  }));
56689
- return createBuiltinPlugin(this.name, rawOptions);
56666
+ return (0, builtin_plugin_base.no)(this.name, rawOptions);
56690
56667
  }
56691
56668
  constructor(options){
56692
56669
  super(), ProvideSharedPlugin_define_property(this, "name", external_rspack_wasi_browser_js_.BuiltinPluginName.ProvideSharedPlugin), ProvideSharedPlugin_define_property(this, "_provides", void 0), ProvideSharedPlugin_define_property(this, "_enhanced", void 0);
@@ -56796,7 +56773,7 @@ function ContainerPlugin_define_property(obj, key, value) {
56796
56773
  else obj[key] = value;
56797
56774
  return obj;
56798
56775
  }
56799
- class ContainerPlugin extends RspackBuiltinPlugin {
56776
+ class ContainerPlugin extends builtin_plugin_base.Xj {
56800
56777
  raw(compiler) {
56801
56778
  const { name, shareScope, library, runtime, filename, exposes, enhanced } = this._options;
56802
56779
  if (!compiler.options.output.enabledLibraryTypes.includes(library.type)) compiler.options.output.enabledLibraryTypes.push(library.type);
@@ -56813,7 +56790,7 @@ class ContainerPlugin extends RspackBuiltinPlugin {
56813
56790
  })),
56814
56791
  enhanced
56815
56792
  };
56816
- return createBuiltinPlugin(this.name, rawOptions);
56793
+ return (0, builtin_plugin_base.no)(this.name, rawOptions);
56817
56794
  }
56818
56795
  constructor(options){
56819
56796
  super(), ContainerPlugin_define_property(this, "name", external_rspack_wasi_browser_js_.BuiltinPluginName.ContainerPlugin), ContainerPlugin_define_property(this, "_options", void 0);
@@ -56851,7 +56828,7 @@ function ContainerReferencePlugin_define_property(obj, key, value) {
56851
56828
  else obj[key] = value;
56852
56829
  return obj;
56853
56830
  }
56854
- class ContainerReferencePlugin extends RspackBuiltinPlugin {
56831
+ class ContainerReferencePlugin extends builtin_plugin_base.Xj {
56855
56832
  raw(compiler) {
56856
56833
  const { remoteType, remotes } = this._options;
56857
56834
  const remoteExternals = {};
@@ -56862,7 +56839,7 @@ class ContainerReferencePlugin extends RspackBuiltinPlugin {
56862
56839
  i++;
56863
56840
  }
56864
56841
  }
56865
- new ExternalsPlugin(remoteType, remoteExternals).apply(compiler);
56842
+ new ExternalsPlugin(remoteType, remoteExternals, true).apply(compiler);
56866
56843
  new ShareRuntimePlugin(this._options.enhanced).apply(compiler);
56867
56844
  const rawOptions = {
56868
56845
  remoteType: this._options.remoteType,
@@ -56872,7 +56849,7 @@ class ContainerReferencePlugin extends RspackBuiltinPlugin {
56872
56849
  })),
56873
56850
  enhanced: this._options.enhanced
56874
56851
  };
56875
- return createBuiltinPlugin(this.name, rawOptions);
56852
+ return (0, builtin_plugin_base.no)(this.name, rawOptions);
56876
56853
  }
56877
56854
  constructor(options){
56878
56855
  super(), ContainerReferencePlugin_define_property(this, "name", external_rspack_wasi_browser_js_.BuiltinPluginName.ContainerReferencePlugin), ContainerReferencePlugin_define_property(this, "_options", void 0);
@@ -56958,7 +56935,7 @@ function transformSync(source, options) {
56958
56935
  const _options = JSON.stringify(options || {});
56959
56936
  return external_rspack_wasi_browser_js_["default"].transformSync(source, _options);
56960
56937
  }
56961
- const exports_rspackVersion = "1.5.0-canary-efb61069-20250820113456";
56938
+ const exports_rspackVersion = "1.5.1-canary-7c68c987-20250828115508";
56962
56939
  const exports_version = "5.75.0";
56963
56940
  const exports_WebpackError = Error;
56964
56941
  const sources = __webpack_require__("../../node_modules/.pnpm/webpack-sources@3.3.3_patch_hash=b2a26650f08a2359d0a3cd81fa6fa272aa7441a28dd7e601792da5ed5d2b4aee/node_modules/webpack-sources/lib/index.js");
@@ -57044,7 +57021,7 @@ const exports_experiments = {
57044
57021
  sync: external_rspack_wasi_browser_js_.sync
57045
57022
  },
57046
57023
  CssChunkingPlugin: CssChunkingPlugin,
57047
- createNativePlugin: createNativePlugin,
57024
+ createNativePlugin: builtin_plugin_base.dE,
57048
57025
  VirtualModulesPlugin: VirtualModulesPlugin
57049
57026
  };
57050
57027
  var rspack_process = __webpack_require__("../../node_modules/.pnpm/process@0.11.10/node_modules/process/browser.js");
@@ -57129,6 +57106,151 @@ const src_fn = Object.assign(rspack_rspack, exports_namespaceObject);
57129
57106
  src_fn.rspack = src_fn;
57130
57107
  src_fn.webpack = src_fn;
57131
57108
  const src_rspack = src_fn;
57109
+ function BrowserHttpImportEsmPlugin_define_property(obj, key, value) {
57110
+ if (key in obj) Object.defineProperty(obj, key, {
57111
+ value: value,
57112
+ enumerable: true,
57113
+ configurable: true,
57114
+ writable: true
57115
+ });
57116
+ else obj[key] = value;
57117
+ return obj;
57118
+ }
57119
+ class BrowserHttpImportEsmPlugin {
57120
+ apply(compiler) {
57121
+ compiler.hooks.normalModuleFactory.tap("BrowserHttpImportPlugin", (nmf)=>{
57122
+ nmf.hooks.resolve.tap("BrowserHttpImportPlugin", (resolveData)=>{
57123
+ const request = resolveData.request;
57124
+ const packageName = getPackageName(request);
57125
+ if (request.includes("!")) return;
57126
+ if (this.options.dependencyUrl) {
57127
+ if ("function" == typeof this.options.dependencyUrl) {
57128
+ const url = this.options.dependencyUrl(packageName);
57129
+ if (url) {
57130
+ resolveData.request = url;
57131
+ return;
57132
+ }
57133
+ } else if ("object" == typeof this.options.dependencyUrl) {
57134
+ const url = this.options.dependencyUrl[packageName];
57135
+ if (url) {
57136
+ resolveData.request = url;
57137
+ return;
57138
+ }
57139
+ }
57140
+ }
57141
+ const issuerUrl = toHttpUrl(resolveData.contextInfo.issuer);
57142
+ if (issuerUrl) {
57143
+ resolveData.request = this.resolveWithUrlIssuer(request, issuerUrl);
57144
+ return;
57145
+ }
57146
+ if (this.isNodeModule(request)) {
57147
+ resolveData.request = this.resolveNodeModule(request, packageName);
57148
+ return;
57149
+ }
57150
+ });
57151
+ });
57152
+ }
57153
+ resolveWithUrlIssuer(request, issuer) {
57154
+ return new URL(request, issuer).href;
57155
+ }
57156
+ resolveNodeModule(request, packageName) {
57157
+ var _this_options_dependencyVersions;
57158
+ let domain = "";
57159
+ if ("function" == typeof this.options.domain) domain = this.options.domain(request, packageName);
57160
+ else if ("string" == typeof this.options.domain) domain = this.options.domain;
57161
+ const version = (null == (_this_options_dependencyVersions = this.options.dependencyVersions) ? void 0 : _this_options_dependencyVersions[packageName]) || "latest";
57162
+ const versionedRequest = getRequestWithVersion(request, version);
57163
+ return `${domain}/${versionedRequest}`;
57164
+ }
57165
+ isNodeModule(request) {
57166
+ if (toHttpUrl(request)) return false;
57167
+ return !request.startsWith(".") && !request.startsWith("/") && !request.startsWith("!");
57168
+ }
57169
+ constructor(options){
57170
+ BrowserHttpImportEsmPlugin_define_property(this, "options", void 0);
57171
+ this.options = options;
57172
+ }
57173
+ }
57174
+ function getPackageName(request) {
57175
+ if (request.startsWith("@")) {
57176
+ const parts = request.split("/");
57177
+ return `${parts[0]}/${parts[1]}`;
57178
+ }
57179
+ return request.split("/")[0];
57180
+ }
57181
+ function getRequestWithVersion(request, version) {
57182
+ if (request.startsWith("@")) {
57183
+ const secondSlashIndex = request.indexOf("/", request.indexOf("/") + 1);
57184
+ if (-1 === secondSlashIndex) return `${request}@${version}`;
57185
+ {
57186
+ const scopedPackage = request.substring(0, secondSlashIndex);
57187
+ const restPath = request.substring(secondSlashIndex);
57188
+ return `${scopedPackage}@${version}${restPath}`;
57189
+ }
57190
+ }
57191
+ {
57192
+ const firstSlashIndex = request.indexOf("/");
57193
+ if (-1 === firstSlashIndex) return `${request}@${version}`;
57194
+ {
57195
+ const packageName = request.substring(0, firstSlashIndex);
57196
+ const restPath = request.substring(firstSlashIndex);
57197
+ return `${packageName}@${version}${restPath}`;
57198
+ }
57199
+ }
57200
+ }
57201
+ function toHttpUrl(request) {
57202
+ try {
57203
+ const url = new URL(request);
57204
+ if ("http:" === url.protocol || "https:" === url.protocol) return url;
57205
+ } catch {
57206
+ return;
57207
+ }
57208
+ }
57209
+ function BrowserRequire_define_property(obj, key, value) {
57210
+ if (key in obj) Object.defineProperty(obj, key, {
57211
+ value: value,
57212
+ enumerable: true,
57213
+ configurable: true,
57214
+ writable: true
57215
+ });
57216
+ else obj[key] = value;
57217
+ return obj;
57218
+ }
57219
+ const unsafeExecute = (code, runtime)=>{
57220
+ const wrapper = new Function("module", "exports", "require", code);
57221
+ wrapper(runtime.module, runtime.exports, runtime.require);
57222
+ };
57223
+ class BrowserRequirePlugin {
57224
+ apply(compiler) {
57225
+ const execute = this.options.execute;
57226
+ compiler.__internal_browser_require = function browserRequire(id) {
57227
+ const { path: loaderPath } = (0, external_rspack_wasi_browser_js_.sync)("", id);
57228
+ if (!loaderPath) throw new Error(`Cannot find loader of ${id}`);
57229
+ const data = browser_fs["default"].readFileSync(loaderPath);
57230
+ const code = (null == data ? void 0 : data.toString()) || "";
57231
+ const module = {
57232
+ exports: {}
57233
+ };
57234
+ const exports = module.exports;
57235
+ const cjs = (0, external_rspack_wasi_browser_js_.transformSync)(code, JSON.stringify({
57236
+ module: {
57237
+ type: "commonjs"
57238
+ }
57239
+ }));
57240
+ execute(cjs.code, {
57241
+ exports,
57242
+ module,
57243
+ require: browserRequire
57244
+ });
57245
+ return exports.default ?? module.exports;
57246
+ };
57247
+ }
57248
+ constructor(options){
57249
+ BrowserRequire_define_property(this, "options", void 0);
57250
+ this.options = options;
57251
+ }
57252
+ }
57253
+ BrowserRequire_define_property(BrowserRequirePlugin, "unsafeExecute", unsafeExecute);
57132
57254
  const builtinMemFs = {
57133
57255
  fs: browser_fs.fs,
57134
57256
  volume: browser_fs.volume
@@ -57141,4 +57263,4 @@ var __webpack_exports__EntryDependency = external_rspack_wasi_browser_js_.EntryD
57141
57263
  var __webpack_exports__ExternalModule = external_rspack_wasi_browser_js_.ExternalModule;
57142
57264
  var __webpack_exports__Module = external_rspack_wasi_browser_js_.Module;
57143
57265
  var __webpack_exports__NormalModule = external_rspack_wasi_browser_js_.NormalModule;
57144
- export { BannerPlugin, CircularDependencyRspackPlugin, Compilation, Compiler, ContextReplacementPlugin, CopyRspackPlugin, CssExtractRspackPlugin, DefinePlugin, DllPlugin, DllReferencePlugin, DynamicEntryPlugin, lib_EntryOptionPlugin as EntryOptionPlugin, EntryPlugin, EnvironmentPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, ExternalsPlugin, HotModuleReplacementPlugin, HtmlRspackPlugin, IgnorePlugin, LightningCssMinimizerRspackPlugin, LoaderOptionsPlugin, LoaderTargetPlugin, ModuleFilenameHelpers_namespaceObject as ModuleFilenameHelpers, MultiCompiler, MultiStats, NoEmitOnErrorsPlugin, NormalModuleReplacementPlugin, ProgressPlugin, ProvidePlugin, RspackOptionsApply, RuntimeGlobals, RuntimeModule, RuntimePlugin, SourceMapDevToolPlugin, Stats, statsFactoryUtils_StatsErrorCode as StatsErrorCode, SwcJsMinimizerRspackPlugin, Template, validate_ValidationError as ValidationError, WarnCaseSensitiveModulesPlugin, exports_WebpackError as WebpackError, RspackOptionsApply as WebpackOptionsApply, builtinMemFs, exports_config as config, container, electron, exports_experiments as experiments, javascript, exports_library as library, exports_node as node, optimize, src_rspack as rspack, exports_rspackVersion as rspackVersion, sharing, sources, exports_util as util, exports_version as version, exports_wasm as wasm, web, webworker, __webpack_exports__AsyncDependenciesBlock as AsyncDependenciesBlock, __webpack_exports__ConcatenatedModule as ConcatenatedModule, __webpack_exports__ContextModule as ContextModule, __webpack_exports__Dependency as Dependency, __webpack_exports__EntryDependency as EntryDependency, __webpack_exports__ExternalModule as ExternalModule, __webpack_exports__Module as Module, __webpack_exports__NormalModule as NormalModule };
57266
+ export { BannerPlugin, BrowserHttpImportEsmPlugin, BrowserRequirePlugin, CircularDependencyRspackPlugin, Compilation, Compiler, ContextReplacementPlugin, CopyRspackPlugin, CssExtractRspackPlugin, DefinePlugin, DllPlugin, DllReferencePlugin, DynamicEntryPlugin, lib_EntryOptionPlugin as EntryOptionPlugin, EntryPlugin, EnvironmentPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, ExternalsPlugin, HotModuleReplacementPlugin, HtmlRspackPlugin, IgnorePlugin, LightningCssMinimizerRspackPlugin, LoaderOptionsPlugin, LoaderTargetPlugin, ModuleFilenameHelpers_namespaceObject as ModuleFilenameHelpers, MultiCompiler, MultiStats, NoEmitOnErrorsPlugin, NormalModuleReplacementPlugin, ProgressPlugin, ProvidePlugin, RspackOptionsApply, RuntimeGlobals, RuntimeModule, RuntimePlugin, SourceMapDevToolPlugin, Stats, statsFactoryUtils_StatsErrorCode as StatsErrorCode, SwcJsMinimizerRspackPlugin, Template, validate_ValidationError as ValidationError, WarnCaseSensitiveModulesPlugin, exports_WebpackError as WebpackError, RspackOptionsApply as WebpackOptionsApply, builtinMemFs, exports_config as config, container, electron, exports_experiments as experiments, javascript, exports_library as library, exports_node as node, optimize, src_rspack as rspack, exports_rspackVersion as rspackVersion, sharing, sources, exports_util as util, exports_version as version, exports_wasm as wasm, web, webworker, __webpack_exports__AsyncDependenciesBlock as AsyncDependenciesBlock, __webpack_exports__ConcatenatedModule as ConcatenatedModule, __webpack_exports__ContextModule as ContextModule, __webpack_exports__Dependency as Dependency, __webpack_exports__EntryDependency as EntryDependency, __webpack_exports__ExternalModule as ExternalModule, __webpack_exports__Module as Module, __webpack_exports__NormalModule as NormalModule };