@rspack-debug/browser 2.0.0-alpha.1 → 2.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -76,7 +76,6 @@ export interface ModuleOptionsNormalized {
76
76
  parser: ParserOptionsByModuleType;
77
77
  generator: GeneratorOptionsByModuleType;
78
78
  noParse?: NoParseOption;
79
- unsafeCache?: boolean | RegExp;
80
79
  }
81
80
  export type CacheNormalized = boolean | {
82
81
  type: 'memory';
@@ -93,10 +92,10 @@ export type CacheNormalized = boolean | {
93
92
  type: 'filesystem';
94
93
  directory: string;
95
94
  };
95
+ portable?: boolean;
96
96
  };
97
97
  export interface ExperimentsNormalized {
98
98
  asyncWebAssembly?: boolean;
99
- outputModule?: boolean;
100
99
  css?: boolean;
101
100
  futureDefaults?: boolean;
102
101
  buildHttp?: HttpUriPluginOptions;
@@ -1044,10 +1044,6 @@ export type ModuleOptions = {
1044
1044
  generator?: GeneratorOptionsByModuleType;
1045
1045
  /** Keep module mechanism of the matched modules as-is, such as module.exports, require, import. */
1046
1046
  noParse?: NoParseOption;
1047
- /**
1048
- * Cache the resolving of module requests.
1049
- */
1050
- unsafeCache?: boolean | RegExp;
1051
1047
  };
1052
1048
  type AllowTarget = 'web' | 'webworker' | 'es3' | 'es5' | 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019' | 'es2020' | 'es2021' | 'es2022' | 'es2023' | 'es2024' | 'es2025' | 'node' | 'async-node' | `node${number}` | `async-node${number}` | `node${number}.${number}` | `async-node${number}.${number}` | 'electron-main' | `electron${number}-main` | `electron${number}.${number}-main` | 'electron-renderer' | `electron${number}-renderer` | `electron${number}.${number}-renderer` | 'electron-preload' | `electron${number}-preload` | `electron${number}.${number}-preload` | 'nwjs' | `nwjs${number}` | `nwjs${number}.${number}` | 'node-webkit' | `node-webkit${number}` | `node-webkit${number}.${number}` | 'browserslist' | `browserslist:${string}`;
1053
1049
  /** Used to configure the target environment of Rspack output and the ECMAScript version of Rspack runtime code. */
@@ -1239,6 +1235,80 @@ export type NodeOptions = {
1239
1235
  export type Node = false | NodeOptions;
1240
1236
  export type Loader = Record<string, any>;
1241
1237
  export type SnapshotOptions = {};
1238
+ /**
1239
+ * Snapshot options for determining which files have been modified.
1240
+ */
1241
+ export type CacheSnapshotOptions = {
1242
+ /**
1243
+ * An array of paths to immutable files, changes to these paths will be ignored during hot restart.
1244
+ */
1245
+ immutablePaths?: (string | RegExp)[];
1246
+ /**
1247
+ * An array of paths in managedPaths that are not managed by the package manager.
1248
+ */
1249
+ unmanagedPaths?: (string | RegExp)[];
1250
+ /**
1251
+ * An array of paths managed by the package manager.
1252
+ * @default [/[\\/]node_modules[\\/][^.]/]
1253
+ */
1254
+ managedPaths?: (string | RegExp)[];
1255
+ };
1256
+ /**
1257
+ * Storage options for persistent cache.
1258
+ */
1259
+ export type CacheStorageOptions = {
1260
+ /**
1261
+ * Storage type, currently only supports 'filesystem'.
1262
+ */
1263
+ type: 'filesystem';
1264
+ /**
1265
+ * Cache directory path.
1266
+ * @default 'node_modules/.cache/rspack'
1267
+ */
1268
+ directory?: string;
1269
+ };
1270
+ /**
1271
+ * Persistent cache options.
1272
+ */
1273
+ export type PersistentCacheOptions = {
1274
+ /**
1275
+ * Cache type.
1276
+ */
1277
+ type: 'persistent';
1278
+ /**
1279
+ * An array of files containing build dependencies, Rspack will use the hash of each of these files to invalidate the persistent cache.
1280
+ * @default []
1281
+ */
1282
+ buildDependencies?: string[];
1283
+ /**
1284
+ * Cache version, different versions of caches are isolated from each other.
1285
+ * @default ""
1286
+ */
1287
+ version?: string;
1288
+ /**
1289
+ * Snapshot options for determining which files have been modified.
1290
+ */
1291
+ snapshot?: CacheSnapshotOptions;
1292
+ /**
1293
+ * Storage options for cache.
1294
+ */
1295
+ storage?: CacheStorageOptions;
1296
+ /**
1297
+ * Enable portable cache mode. When enabled, the generated cache content can be shared across different platforms and paths within the same project.
1298
+ * @description Portable cache makes the cache platform-independent by converting platform-specific data (e.g., absolute paths to relative paths) during serialization and deserialization.
1299
+ * @default false
1300
+ */
1301
+ portable?: boolean;
1302
+ };
1303
+ /**
1304
+ * Memory cache options.
1305
+ */
1306
+ export type MemoryCacheOptions = {
1307
+ /**
1308
+ * Cache type.
1309
+ */
1310
+ type: 'memory';
1311
+ };
1242
1312
  /**
1243
1313
  * Options for caching snapshots and intermediate products during the build process.
1244
1314
  * @description Controls whether caching is enabled or disabled.
@@ -1250,22 +1320,7 @@ export type SnapshotOptions = {};
1250
1320
  * // Disable caching
1251
1321
  * cache: false
1252
1322
  */
1253
- export type CacheOptions = boolean | {
1254
- type: 'memory';
1255
- } | {
1256
- type: 'persistent';
1257
- buildDependencies?: string[];
1258
- version?: string;
1259
- snapshot?: {
1260
- immutablePaths?: (string | RegExp)[];
1261
- unmanagedPaths?: (string | RegExp)[];
1262
- managedPaths?: (string | RegExp)[];
1263
- };
1264
- storage?: {
1265
- type: 'filesystem';
1266
- directory?: string;
1267
- };
1268
- };
1323
+ export type CacheOptions = boolean | MemoryCacheOptions | PersistentCacheOptions;
1269
1324
  export type StatsPresets = 'normal' | 'none' | 'verbose' | 'errors-only' | 'errors-warnings' | 'minimal' | 'detailed' | 'summary';
1270
1325
  type ModuleFilterItemTypes = RegExp | string | ((name: string, module: any, type: any) => boolean);
1271
1326
  type ModuleFilterTypes = boolean | ModuleFilterItemTypes | ModuleFilterItemTypes[];
@@ -2063,11 +2118,6 @@ export type Experiments = {
2063
2118
  * @default false
2064
2119
  */
2065
2120
  asyncWebAssembly?: boolean;
2066
- /**
2067
- * Enable output as ES module.
2068
- * @default false
2069
- */
2070
- outputModule?: boolean;
2071
2121
  /**
2072
2122
  * Enable CSS support.
2073
2123
  *
package/dist/index.d.ts CHANGED
@@ -8,3 +8,4 @@ declare const rspack: Rspack;
8
8
  export * from './exports';
9
9
  export default rspack;
10
10
  export { rspack };
11
+ export { rspack as 'module.exports' };
package/dist/index.js CHANGED
@@ -16681,92 +16681,6 @@ __webpack_require__.add({
16681
16681
  return hasSymbols() && !!Symbol.toStringTag;
16682
16682
  };
16683
16683
  },
16684
- "../../node_modules/.pnpm/hash-base@3.0.5/node_modules/hash-base/index.js" (module, __unused_rspack_exports, __webpack_require__) {
16685
- var Buffer = __webpack_require__("../../node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js").Buffer;
16686
- var Transform = __webpack_require__("../../node_modules/.pnpm/stream-browserify@3.0.0/node_modules/stream-browserify/index.js").Transform;
16687
- var inherits = __webpack_require__("../../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js");
16688
- function HashBase(blockSize) {
16689
- Transform.call(this);
16690
- this._block = Buffer.allocUnsafe(blockSize);
16691
- this._blockSize = blockSize;
16692
- this._blockOffset = 0;
16693
- this._length = [
16694
- 0,
16695
- 0,
16696
- 0,
16697
- 0
16698
- ];
16699
- this._finalized = false;
16700
- }
16701
- inherits(HashBase, Transform);
16702
- HashBase.prototype._transform = function(chunk, encoding, callback) {
16703
- var error = null;
16704
- try {
16705
- this.update(chunk, encoding);
16706
- } catch (err) {
16707
- error = err;
16708
- }
16709
- callback(error);
16710
- };
16711
- HashBase.prototype._flush = function(callback) {
16712
- var error = null;
16713
- try {
16714
- this.push(this.digest());
16715
- } catch (err) {
16716
- error = err;
16717
- }
16718
- callback(error);
16719
- };
16720
- var useUint8Array = "u" > typeof Uint8Array;
16721
- var useArrayBuffer = "u" > typeof ArrayBuffer && "u" > typeof Uint8Array && ArrayBuffer.isView && (Buffer.prototype instanceof Uint8Array || Buffer.TYPED_ARRAY_SUPPORT);
16722
- function toBuffer(data, encoding) {
16723
- if (data instanceof Buffer) return data;
16724
- if ('string' == typeof data) return Buffer.from(data, encoding);
16725
- if (useArrayBuffer && ArrayBuffer.isView(data)) {
16726
- if (0 === data.byteLength) return Buffer.alloc(0);
16727
- var res = Buffer.from(data.buffer, data.byteOffset, data.byteLength);
16728
- if (res.byteLength === data.byteLength) return res;
16729
- }
16730
- if (useUint8Array && data instanceof Uint8Array) return Buffer.from(data);
16731
- if (Buffer.isBuffer(data) && data.constructor && 'function' == typeof data.constructor.isBuffer && data.constructor.isBuffer(data)) return Buffer.from(data);
16732
- throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.');
16733
- }
16734
- HashBase.prototype.update = function(data, encoding) {
16735
- if (this._finalized) throw new Error('Digest already called');
16736
- data = toBuffer(data, encoding);
16737
- var block = this._block;
16738
- var offset = 0;
16739
- while(this._blockOffset + data.length - offset >= this._blockSize){
16740
- for(var i = this._blockOffset; i < this._blockSize;)block[i++] = data[offset++];
16741
- this._update();
16742
- this._blockOffset = 0;
16743
- }
16744
- while(offset < data.length)block[this._blockOffset++] = data[offset++];
16745
- for(var j = 0, carry = 8 * data.length; carry > 0; ++j){
16746
- this._length[j] += carry;
16747
- carry = this._length[j] / 0x0100000000 | 0;
16748
- if (carry > 0) this._length[j] -= 0x0100000000 * carry;
16749
- }
16750
- return this;
16751
- };
16752
- HashBase.prototype._update = function() {
16753
- throw new Error('_update is not implemented');
16754
- };
16755
- HashBase.prototype.digest = function(encoding) {
16756
- if (this._finalized) throw new Error('Digest already called');
16757
- this._finalized = true;
16758
- var digest = this._digest();
16759
- if (void 0 !== encoding) digest = digest.toString(encoding);
16760
- this._block.fill(0);
16761
- this._blockOffset = 0;
16762
- for(var i = 0; i < 4; ++i)this._length[i] = 0;
16763
- return digest;
16764
- };
16765
- HashBase.prototype._digest = function() {
16766
- throw new Error('_digest is not implemented');
16767
- };
16768
- module.exports = HashBase;
16769
- },
16770
16684
  "../../node_modules/.pnpm/hash-base@3.1.2/node_modules/hash-base/index.js" (module, __unused_rspack_exports, __webpack_require__) {
16771
16685
  var Buffer = __webpack_require__("../../node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js").Buffer;
16772
16686
  var toBuffer = __webpack_require__("../../node_modules/.pnpm/hash-base@3.1.2/node_modules/hash-base/to-buffer.js");
@@ -18680,7 +18594,7 @@ __webpack_require__.add({
18680
18594
  },
18681
18595
  "../../node_modules/.pnpm/md5.js@1.3.5/node_modules/md5.js/index.js" (module, __unused_rspack_exports, __webpack_require__) {
18682
18596
  var inherits = __webpack_require__("../../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js");
18683
- var HashBase = __webpack_require__("../../node_modules/.pnpm/hash-base@3.0.5/node_modules/hash-base/index.js");
18597
+ var HashBase = __webpack_require__("../../node_modules/.pnpm/hash-base@3.1.2/node_modules/hash-base/index.js");
18684
18598
  var Buffer = __webpack_require__("../../node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js").Buffer;
18685
18599
  var ARRAY16 = new Array(16);
18686
18600
  function MD5() {
@@ -51879,6 +51793,17 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
51879
51793
  afterSeal: new AsyncSeriesHook([]),
51880
51794
  needAdditionalPass: new SyncBailHook([])
51881
51795
  };
51796
+ const availableHooks = Object.keys(this.hooks);
51797
+ this.hooks = new Proxy(this.hooks, {
51798
+ get (target, prop, receiver) {
51799
+ const value = Reflect.get(target, prop, receiver);
51800
+ if (void 0 === value && 'string' == typeof prop) {
51801
+ const hooksList = availableHooks.join(', ');
51802
+ throw new Error(`Compilation.hooks.${prop} is not supported in rspack. This typically happens when using webpack plugins that rely on webpack-specific hooks. Consider using an rspack-compatible alternative or removing the incompatible plugin.\n\nAvailable compilation hooks: ${hooksList}`);
51803
+ }
51804
+ return value;
51805
+ }
51806
+ });
51882
51807
  this.compiler = compiler;
51883
51808
  this.resolverFactory = compiler.resolverFactory;
51884
51809
  this.inputFileSystem = compiler.inputFileSystem;
@@ -52825,7 +52750,6 @@ function applyLimits(options) {
52825
52750
  options.optimization.concatenateModules = false;
52826
52751
  options.optimization.removeEmptyChunks = false;
52827
52752
  options.output.chunkFormat = false;
52828
- options.output.module = true;
52829
52753
  if (options.output.chunkLoading && 'import' !== options.output.chunkLoading) options.output.chunkLoading = 'import';
52830
52754
  if (void 0 === options.output.chunkLoading) options.output.chunkLoading = 'import';
52831
52755
  let { splitChunks } = options.optimization;
@@ -54915,8 +54839,7 @@ function getRawModule(module, options) {
54915
54839
  rules,
54916
54840
  parser: getRawParserOptionsMap(module.parser),
54917
54841
  generator: getRawGeneratorOptionsMap(module.generator),
54918
- noParse: module.noParse,
54919
- unsafeCache: module.unsafeCache
54842
+ noParse: module.noParse
54920
54843
  };
54921
54844
  }
54922
54845
  function tryMatch(payload, condition) {
@@ -57676,7 +57599,6 @@ const applyRspackOptionsDefaults = (options)=>{
57676
57599
  production
57677
57600
  });
57678
57601
  applyModuleDefaults(options.module, {
57679
- cache: !!options.cache,
57680
57602
  asyncWebAssembly: options.experiments.asyncWebAssembly,
57681
57603
  targetProperties,
57682
57604
  mode: options.mode,
@@ -57687,7 +57609,6 @@ const applyRspackOptionsDefaults = (options)=>{
57687
57609
  context: options.context,
57688
57610
  targetProperties,
57689
57611
  isAffectedByBrowserslist: void 0 === target || 'string' == typeof target && target.startsWith('browserslist') || Array.isArray(target) && target.some((target)=>target.startsWith('browserslist')),
57690
- outputModule: options.experiments.outputModule,
57691
57612
  entry: options.entry
57692
57613
  });
57693
57614
  applyExternalsPresetsDefaults(options.externalsPresets, {
@@ -57754,7 +57675,7 @@ const applyIncrementalDefaults = (options)=>{
57754
57675
  D(options.incremental, 'buildModuleGraph', true);
57755
57676
  D(options.incremental, 'finishModules', true);
57756
57677
  D(options.incremental, 'optimizeDependencies', true);
57757
- D(options.incremental, 'buildChunkGraph', false);
57678
+ D(options.incremental, 'buildChunkGraph', true);
57758
57679
  D(options.incremental, 'moduleIds', true);
57759
57680
  D(options.incremental, 'chunkIds', true);
57760
57681
  D(options.incremental, 'modulesHashes', true);
@@ -57798,10 +57719,9 @@ const applyCssGeneratorOptionsDefaults = (generatorOptions, { targetProperties }
57798
57719
  const applyJsonGeneratorOptionsDefaults = (generatorOptions)=>{
57799
57720
  D(generatorOptions, 'JSONParse', true);
57800
57721
  };
57801
- const applyModuleDefaults = (module, { cache, asyncWebAssembly, targetProperties, mode, uniqueName, deferImport })=>{
57722
+ const applyModuleDefaults = (module, { asyncWebAssembly, targetProperties, mode, uniqueName, deferImport })=>{
57802
57723
  assertNotNill(module.parser);
57803
57724
  assertNotNill(module.generator);
57804
- cache ? D(module, 'unsafeCache', /[\\/]node_modules[\\/]/) : D(module, 'unsafeCache', false);
57805
57725
  F(module.parser, "asset", ()=>({}));
57806
57726
  assertNotNill(module.parser.asset);
57807
57727
  F(module.parser.asset, 'dataUrlCondition', ()=>({}));
@@ -57961,7 +57881,7 @@ const applyModuleDefaults = (module, { cache, asyncWebAssembly, targetProperties
57961
57881
  return rules;
57962
57882
  });
57963
57883
  };
57964
- const applyOutputDefaults = (options, { context, outputModule, targetProperties: tp, isAffectedByBrowserslist, entry })=>{
57884
+ const applyOutputDefaults = (options, { context, targetProperties: tp, isAffectedByBrowserslist, entry })=>{
57965
57885
  const { output } = options;
57966
57886
  const getLibraryName = (library)=>{
57967
57887
  const libraryName = 'object' == typeof library && library && !Array.isArray(library) ? library.name : library;
@@ -57990,7 +57910,24 @@ const applyOutputDefaults = (options, { context, outputModule, targetProperties:
57990
57910
  }
57991
57911
  });
57992
57912
  F(output, 'devtoolNamespace', ()=>output.uniqueName);
57993
- F(output, 'module', ()=>!!outputModule);
57913
+ if (output.library) F(output.library, 'type', ()=>output.module ? 'modern-module' : 'var');
57914
+ const forEachEntry = (fn)=>{
57915
+ if ('function' == typeof entry) return;
57916
+ for (const name of Object.keys(entry))fn(entry[name]);
57917
+ };
57918
+ A(output, 'enabledLibraryTypes', ()=>{
57919
+ const enabledLibraryTypes = [];
57920
+ if (output.library) enabledLibraryTypes.push(output.library.type);
57921
+ forEachEntry((desc)=>{
57922
+ if (desc.library) enabledLibraryTypes.push(desc.library.type);
57923
+ });
57924
+ if (enabledLibraryTypes.includes('modern-module')) applyLimits(options);
57925
+ return enabledLibraryTypes;
57926
+ });
57927
+ D(output, 'module', [
57928
+ 'modern-module',
57929
+ 'module'
57930
+ ].some((ty)=>output.enabledLibraryTypes.includes(ty)));
57994
57931
  const environment = output.environment;
57995
57932
  const optimistic = (v)=>v || void 0 === v;
57996
57933
  const conditionallyOptimistic = (v, c)=>void 0 === v && c || v;
@@ -58049,7 +57986,6 @@ const applyOutputDefaults = (options, { context, outputModule, targetProperties:
58049
57986
  D(output, 'hashDigest', 'hex');
58050
57987
  D(output, 'hashDigestLength', 16);
58051
57988
  D(output, 'strictModuleErrorHandling', false);
58052
- if (output.library) F(output.library, 'type', ()=>output.module ? 'module' : 'var');
58053
57989
  F(output, 'chunkFormat', ()=>{
58054
57990
  if (tp) {
58055
57991
  const helpMessage = isAffectedByBrowserslist ? "Make sure that your 'browserslist' includes only platforms that support these features or select an appropriate 'target' to allow selecting a chunk format by default. Alternatively specify the 'output.chunkFormat' directly." : "Select an appropriate 'target' to allow selecting one by default, or specify the 'output.chunkFormat' directly.";
@@ -58133,19 +58069,6 @@ const applyOutputDefaults = (options, { context, outputModule, targetProperties:
58133
58069
  F(trustedTypes, 'policyName', ()=>output.uniqueName.replace(/[^a-zA-Z0-9\-#=_/@.%]+/g, '_') || 'rspack');
58134
58070
  D(trustedTypes, 'onPolicyCreationFailure', 'stop');
58135
58071
  }
58136
- const forEachEntry = (fn)=>{
58137
- if ('function' == typeof entry) return;
58138
- for (const name of Object.keys(entry))fn(entry[name]);
58139
- };
58140
- A(output, 'enabledLibraryTypes', ()=>{
58141
- const enabledLibraryTypes = [];
58142
- if (output.library) enabledLibraryTypes.push(output.library.type);
58143
- forEachEntry((desc)=>{
58144
- if (desc.library) enabledLibraryTypes.push(desc.library.type);
58145
- });
58146
- if (enabledLibraryTypes.includes('modern-module')) applyLimits(options);
58147
- return enabledLibraryTypes;
58148
- });
58149
58072
  A(output, 'enabledChunkLoadingTypes', ()=>{
58150
58073
  const enabledChunkLoadingTypes = new Set();
58151
58074
  if (output.chunkLoading) enabledChunkLoadingTypes.add(output.chunkLoading);
@@ -58166,7 +58089,7 @@ const applyOutputDefaults = (options, { context, outputModule, targetProperties:
58166
58089
  });
58167
58090
  D(output, 'bundlerInfo', {});
58168
58091
  if ('object' == typeof output.bundlerInfo) {
58169
- D(output.bundlerInfo, 'version', "2.0.0-alpha.1");
58092
+ D(output.bundlerInfo, 'version', "2.0.0-beta.0");
58170
58093
  D(output.bundlerInfo, 'bundler', 'rspack');
58171
58094
  D(output.bundlerInfo, 'force', !output.library);
58172
58095
  }
@@ -58568,8 +58491,7 @@ const getNormalizedRspackOptions = (config)=>({
58568
58491
  ]),
58569
58492
  rules: nestedArray(module.rules, (r)=>[
58570
58493
  ...r
58571
- ]),
58572
- unsafeCache: module.unsafeCache
58494
+ ])
58573
58495
  })),
58574
58496
  target: config.target,
58575
58497
  externals: config.externals,
@@ -58606,7 +58528,8 @@ const getNormalizedRspackOptions = (config)=>({
58606
58528
  storage: {
58607
58529
  type: 'filesystem',
58608
58530
  directory: path_browserify_default().resolve(config.context || normalization_process.cwd(), cache.storage?.directory || 'node_modules/.cache/rspack')
58609
- }
58531
+ },
58532
+ portable: cache.portable
58610
58533
  };
58611
58534
  }),
58612
58535
  stats: nestedConfig(config.stats, (stats)=>{
@@ -58719,7 +58642,7 @@ const getNormalizedIncrementalOptions = (incremental)=>{
58719
58642
  buildModuleGraph: true,
58720
58643
  finishModules: false,
58721
58644
  optimizeDependencies: false,
58722
- buildChunkGraph: false,
58645
+ buildChunkGraph: true,
58723
58646
  moduleIds: false,
58724
58647
  chunkIds: false,
58725
58648
  modulesHashes: false,
@@ -59826,7 +59749,7 @@ class MultiStats {
59826
59749
  return obj;
59827
59750
  });
59828
59751
  if (childOptions.version) {
59829
- obj.rspackVersion = "2.0.0-alpha.1";
59752
+ obj.rspackVersion = "2.0.0-beta.0";
59830
59753
  obj.version = "5.75.0";
59831
59754
  }
59832
59755
  if (childOptions.hash) obj.hash = obj.children.map((j)=>j.hash).join('');
@@ -61512,7 +61435,7 @@ const SIMPLE_EXTRACTORS = {
61512
61435
  },
61513
61436
  version: (object)=>{
61514
61437
  object.version = "5.75.0";
61515
- object.rspackVersion = "2.0.0-alpha.1";
61438
+ object.rspackVersion = "2.0.0-beta.0";
61516
61439
  },
61517
61440
  env: (object, _compilation, _context, { _env })=>{
61518
61441
  object.env = _env;
@@ -64357,6 +64280,17 @@ class Compiler {
64357
64280
  ]),
64358
64281
  additionalPass: new AsyncSeriesHook([])
64359
64282
  };
64283
+ const availableCompilerHooks = Object.keys(this.hooks);
64284
+ this.hooks = new Proxy(this.hooks, {
64285
+ get (target, prop, receiver) {
64286
+ const value = Reflect.get(target, prop, receiver);
64287
+ if (void 0 === value && 'string' == typeof prop) {
64288
+ const hooksList = availableCompilerHooks.join(', ');
64289
+ throw new Error(`Compiler.hooks.${prop} is not supported in rspack. This typically happens when using webpack plugins that rely on webpack-specific hooks. Consider using an rspack-compatible alternative or removing the incompatible plugin.\n\nAvailable compiler hooks: ${hooksList}`);
64290
+ }
64291
+ return value;
64292
+ }
64293
+ });
64360
64294
  const compilerRuntimeGlobals = createCompilerRuntimeGlobals(options);
64361
64295
  const compilerFn = function(...params) {
64362
64296
  return rspack(...params);
@@ -65739,7 +65673,7 @@ function transformSync(source, options) {
65739
65673
  const _options = JSON.stringify(options || {});
65740
65674
  return external_rspack_wasi_browser_js_["default"].transformSync(source, _options);
65741
65675
  }
65742
- const exports_rspackVersion = "2.0.0-alpha.1";
65676
+ const exports_rspackVersion = "2.0.0-beta.0";
65743
65677
  const exports_version = "5.75.0";
65744
65678
  const exports_WebpackError = Error;
65745
65679
  const exports_config = {
@@ -65999,4 +65933,4 @@ const builtinMemFs = {
65999
65933
  volume: fs_0.volume,
66000
65934
  memfs: fs_0.memfs
66001
65935
  };
66002
- export { AsyncDependenciesBlock, BannerPlugin, BrowserHttpImportEsmPlugin, BrowserRequirePlugin, CaseSensitivePlugin, CircularDependencyRspackPlugin, Compilation, Compiler, ConcatenatedModule, ContextModule, ContextReplacementPlugin, CopyRspackPlugin, CssExtractRspackPlugin, DefaultRuntimeGlobals as RuntimeGlobals, DefinePlugin, Dependency, DllPlugin, DllReferencePlugin, DynamicEntryPlugin, EntryDependency, EntryPlugin, EnvironmentPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, ExternalModule, ExternalsPlugin, HotModuleReplacementPlugin, HtmlRspackPlugin, IgnorePlugin, LightningCssMinimizerRspackPlugin, LoaderOptionsPlugin, LoaderTargetPlugin, Module, ModuleFilenameHelpers_namespaceObject as ModuleFilenameHelpers, MultiCompiler, MultiStats, NoEmitOnErrorsPlugin, NormalModule, NormalModuleReplacementPlugin, ProgressPlugin, ProvidePlugin, RspackOptionsApply, RspackOptionsApply as WebpackOptionsApply, RuntimeModule, RuntimePlugin, SourceMapDevToolPlugin, Stats, SubresourceIntegrityPlugin, SwcJsMinimizerRspackPlugin, Template, ValidationError, builtinMemFs, container, electron, exports_WebpackError as WebpackError, exports_config as config, exports_experiments as experiments, exports_library as library, exports_node as node, exports_rspackVersion as rspackVersion, exports_version as version, exports_wasm as wasm, javascript, lazyCompilationMiddleware, lib as sources, lib_EntryOptionPlugin as EntryOptionPlugin, optimize, sharing, src_rspack_0 as rspack, statsFactoryUtils_StatsErrorCode as StatsErrorCode, util, web, webworker };
65936
+ export { AsyncDependenciesBlock, BannerPlugin, BrowserHttpImportEsmPlugin, BrowserRequirePlugin, CaseSensitivePlugin, CircularDependencyRspackPlugin, Compilation, Compiler, ConcatenatedModule, ContextModule, ContextReplacementPlugin, CopyRspackPlugin, CssExtractRspackPlugin, DefaultRuntimeGlobals as RuntimeGlobals, DefinePlugin, Dependency, DllPlugin, DllReferencePlugin, DynamicEntryPlugin, EntryDependency, EntryPlugin, EnvironmentPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, ExternalModule, ExternalsPlugin, HotModuleReplacementPlugin, HtmlRspackPlugin, IgnorePlugin, LightningCssMinimizerRspackPlugin, LoaderOptionsPlugin, LoaderTargetPlugin, Module, ModuleFilenameHelpers_namespaceObject as ModuleFilenameHelpers, MultiCompiler, MultiStats, NoEmitOnErrorsPlugin, NormalModule, NormalModuleReplacementPlugin, ProgressPlugin, ProvidePlugin, RspackOptionsApply, RspackOptionsApply as WebpackOptionsApply, RuntimeModule, RuntimePlugin, SourceMapDevToolPlugin, Stats, SubresourceIntegrityPlugin, SwcJsMinimizerRspackPlugin, Template, ValidationError, builtinMemFs, container, electron, exports_WebpackError as WebpackError, exports_config as config, exports_experiments as experiments, exports_library as library, exports_node as node, exports_rspackVersion as rspackVersion, exports_version as version, exports_wasm as wasm, javascript, lazyCompilationMiddleware, lib as sources, lib_EntryOptionPlugin as EntryOptionPlugin, optimize, sharing, src_rspack_0 as "module.exports", src_rspack_0 as rspack, statsFactoryUtils_StatsErrorCode as StatsErrorCode, util, web, webworker };
@@ -1851,6 +1851,7 @@ export interface RawCacheOptionsPersistent {
1851
1851
  version?: string
1852
1852
  snapshot?: RawSnapshotOptions
1853
1853
  storage?: RawStorageOptions
1854
+ portable?: boolean
1854
1855
  }
1855
1856
 
1856
1857
  export interface RawCircularDependencyRspackPluginOptions {
@@ -2513,7 +2514,6 @@ export interface RawModuleOptions {
2513
2514
  parser?: Record<string, RawParserOptions>
2514
2515
  generator?: Record<string, RawGeneratorOptions>
2515
2516
  noParse?: string | RegExp | ((request: string) => boolean) | (string | RegExp | ((request: string) => boolean))[]
2516
- unsafeCache?: boolean | RegExp
2517
2517
  }
2518
2518
 
2519
2519
  export interface RawModuleRule {
@@ -2800,6 +2800,7 @@ export interface RawRstestPluginOptions {
2800
2800
  hoistMockModule: boolean
2801
2801
  manualMockRoot: string
2802
2802
  preserveNewUrl?: Array<string>
2803
+ globals?: boolean
2803
2804
  }
2804
2805
 
2805
2806
  export interface RawRuleSetCondition {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack-debug/browser",
3
- "version": "2.0.0-alpha.1",
3
+ "version": "2.0.0-beta.0",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "Rspack for running in the browser. This is still in early stage and may not follow the semver.",