@rspack/browser 2.0.0-rc.1 → 2.0.0-rc.3

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.
@@ -1,7 +1,7 @@
1
- import { CIRCULAR_CONNECTION_SYMBOL, ModuleGraphConnection as BindingModuleGraphConnection, TRANSITIVE_ONLY_SYMBOL } from './binding';
1
+ import binding, { ModuleGraphConnection as BindingModuleGraphConnection } from './binding';
2
2
  type ModuleGraphConnectionConstructor = typeof BindingModuleGraphConnection & {
3
- readonly TRANSITIVE_ONLY: typeof TRANSITIVE_ONLY_SYMBOL;
4
- readonly CIRCULAR_CONNECTION: typeof CIRCULAR_CONNECTION_SYMBOL;
3
+ readonly TRANSITIVE_ONLY: typeof binding.TRANSITIVE_ONLY_SYMBOL;
4
+ readonly CIRCULAR_CONNECTION: typeof binding.CIRCULAR_CONNECTION_SYMBOL;
5
5
  };
6
6
  export interface ModuleGraphConnection extends BindingModuleGraphConnection {
7
7
  }
@@ -83,5 +83,4 @@ export * from './SplitChunksPlugin';
83
83
  export * from './SubresourceIntegrityPlugin';
84
84
  export * from './SwcJsMinimizerPlugin';
85
85
  export * from './URLPlugin';
86
- export * from './WebWorkerTemplatePlugin';
87
86
  export * from './WorkerPlugin';
@@ -10,7 +10,7 @@
10
10
  import type { ReadStream } from 'node:fs';
11
11
  import type { IncomingMessage, ServerResponse } from 'node:http';
12
12
  import type { ServerOptions } from 'node:https';
13
- import type { Server as ConnectApplication, NextFunction } from 'connect-next';
13
+ import type { NextFunction } from 'connect-next';
14
14
  import type { Filter as ProxyFilter, Options as ProxyOptions } from 'http-proxy-middleware';
15
15
  import type { Options as OpenOptions } from 'open';
16
16
  import type { Compiler, Configuration, LiteralUnion, MultiCompiler, MultiStats, Stats, Watching } from '..';
@@ -153,7 +153,7 @@ export type DevServerClient = {
153
153
  webSocketTransport?: LiteralUnion<'ws', string>;
154
154
  webSocketURL?: string | DevServerWebSocketURL;
155
155
  };
156
- export type DevServerOptions<A extends BasicApplication = ConnectApplication, S extends BasicServer = BasicServer> = {
156
+ export type DevServerOptions<A extends BasicApplication = BasicApplication, S extends BasicServer = BasicServer> = {
157
157
  ipc?: string | boolean;
158
158
  host?: DevServerHost;
159
159
  port?: Port;
@@ -153,7 +153,7 @@ export type EntryStatic = EntryObject | EntryUnnamed;
153
153
  export type EntryDynamic = () => EntryStatic | Promise<EntryStatic>;
154
154
  /** The entry options for building */
155
155
  export type Entry = EntryStatic | EntryDynamic;
156
- /** The output directory as an absolute path. */
156
+ /** The output directory. Relative paths are resolved against `context`. */
157
157
  export type Path = string;
158
158
  /** Tells Rspack to include comments in bundles with information about the contained modules. */
159
159
  export type Pathinfo = boolean | 'verbose';
@@ -210,7 +210,7 @@ export type WorkerPublicPath = string;
210
210
  /** Controls [Trusted Types](https://web.dev/articles/trusted-types) compatibility. */
211
211
  export type TrustedTypes = {
212
212
  /**
213
- * The name of the Trusted Types policy created by webpack to serve bundle chunks.
213
+ * The name of the Trusted Types policy created by Rspack to serve bundle chunks.
214
214
  */
215
215
  policyName?: string;
216
216
  /**
@@ -288,7 +288,7 @@ export type Environment = {
288
288
  module?: boolean;
289
289
  /**
290
290
  * Determines if the node: prefix is generated for core module imports in environments that support it.
291
- * This is only applicable to Webpack runtime code.
291
+ * This is only applicable to Rspack runtime code.
292
292
  * */
293
293
  nodePrefixForCoreModules?: boolean;
294
294
  /** The environment supports optional chaining ('obj?.a' or 'obj?.()'). */
@@ -298,7 +298,7 @@ export type Environment = {
298
298
  };
299
299
  export type Output = {
300
300
  /**
301
- * The output directory as an absolute path.
301
+ * The output directory. Relative paths are resolved against `context`.
302
302
  * @default path.resolve(process.cwd(), 'dist')
303
303
  * */
304
304
  path?: Path;
@@ -631,8 +631,30 @@ export type RuleSetLoaderWithOptions = {
631
631
  };
632
632
  export type RuleSetUseItem = RuleSetLoader | RuleSetLoaderWithOptions;
633
633
  export type RuleSetUse = RuleSetUseItem | RuleSetUseItem[] | ((data: RawFuncUseCtx) => RuleSetUseItem[]);
634
+ export type RuleSetRuleUseAndLoader = {
635
+ /** A loader name */
636
+ loader: RuleSetLoader;
637
+ /** A loader options */
638
+ options?: RuleSetLoaderOptions;
639
+ /** An array to pass the Loader package name and its options. */
640
+ use?: never;
641
+ } | {
642
+ /** A loader name */
643
+ loader?: never;
644
+ /** A loader options */
645
+ options?: never;
646
+ /** An array to pass the Loader package name and its options. */
647
+ use: RuleSetUse;
648
+ } | {
649
+ /** A loader name */
650
+ loader?: never;
651
+ /** A loader options */
652
+ options?: never;
653
+ /** An array to pass the Loader package name and its options. */
654
+ use?: never;
655
+ };
634
656
  /** Rule defines the conditions for matching a module and the behavior of handling those modules. */
635
- export type RuleSetRule = {
657
+ export type RuleSetRule = RuleSetRuleUseAndLoader & {
636
658
  /** Matches all modules that match this resource, and will match against Resource. */
637
659
  test?: RuleSetCondition;
638
660
  /** Excludes all modules that match this condition and will match against the absolute path of the resource */
@@ -663,12 +685,6 @@ export type RuleSetRule = {
663
685
  type?: string;
664
686
  /** Used to mark the layer of the matching module. */
665
687
  layer?: string;
666
- /** A loader name */
667
- loader?: RuleSetLoader;
668
- /** A loader options */
669
- options?: RuleSetLoaderOptions;
670
- /** An array to pass the Loader package name and its options. */
671
- use?: RuleSetUse;
672
688
  /**
673
689
  * Parser options for the specific modules that matched by the rule conditions
674
690
  * It will override the parser options in module.parser.
@@ -1358,6 +1374,8 @@ export type MemoryCacheOptions = {
1358
1374
  */
1359
1375
  export type CacheOptions = boolean | MemoryCacheOptions | PersistentCacheOptions;
1360
1376
  export type StatsPresets = 'normal' | 'none' | 'verbose' | 'errors-only' | 'errors-warnings' | 'minimal' | 'detailed' | 'summary';
1377
+ type AssetFilterItemTypes = RegExp | string | ((name: string, asset: any) => boolean);
1378
+ type AssetFilterTypes = boolean | AssetFilterItemTypes | AssetFilterItemTypes[];
1361
1379
  type ModuleFilterItemTypes = RegExp | string | ((name: string, module: any, type: any) => boolean);
1362
1380
  type ModuleFilterTypes = boolean | ModuleFilterItemTypes | ModuleFilterItemTypes[];
1363
1381
  export type StatsColorOptions = {
@@ -1642,7 +1660,7 @@ export type StatsOptions = {
1642
1660
  * Exclude the matching assets information.
1643
1661
  * @default false
1644
1662
  */
1645
- excludeAssets?: ModuleFilterTypes;
1663
+ excludeAssets?: AssetFilterTypes;
1646
1664
  /**
1647
1665
  * Specifies the sorting order for modules.
1648
1666
  * @default 'id'
@@ -1822,6 +1840,13 @@ type SharedOptimizationSplitChunksCacheGroup = {
1822
1840
  */
1823
1841
  minSize?: OptimizationSplitChunksSizes;
1824
1842
  minSizeReduction?: OptimizationSplitChunksSizes;
1843
+ /**
1844
+ * Size threshold at which splitting is enforced and other restrictions
1845
+ * (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
1846
+ * The value is `50000` in production mode.
1847
+ * The value is `30000` in others mode.
1848
+ */
1849
+ enforceSizeThreshold?: OptimizationSplitChunksSizes;
1825
1850
  /** Maximum size, in bytes, for a chunk to be generated. */
1826
1851
  maxSize?: OptimizationSplitChunksSizes;
1827
1852
  /** Maximum size, in bytes, for a async chunk to be generated. */
@@ -2216,13 +2241,13 @@ export type Watch = boolean;
2216
2241
  export type WatchOptions = {
2217
2242
  /**
2218
2243
  * Add a delay before rebuilding once the first file changed.
2219
- * This allows webpack to aggregate any other changes made during this time period into one rebuild.
2244
+ * This allows Rspack to aggregate any other changes made during this time period into one rebuild.
2220
2245
  * @default 5
2221
2246
  */
2222
2247
  aggregateTimeout?: number;
2223
2248
  /**
2224
2249
  * Follow symlinks while looking for files.
2225
- * This is usually not needed as webpack already resolves symlinks ('resolve.symlinks' and 'resolve.alias').
2250
+ * This is usually not needed as Rspack already resolves symlinks ('resolve.symlinks' and 'resolve.alias').
2226
2251
  */
2227
2252
  followSymlinks?: boolean;
2228
2253
  /**
@@ -2281,13 +2306,13 @@ export type Performance = false | {
2281
2306
  */
2282
2307
  hints?: false | 'warning' | 'error';
2283
2308
  /**
2284
- * File size limit (in bytes) when exceeded, that webpack will provide performance hints.
2285
- * @default 250000
2309
+ * File size limit (in bytes) when exceeded, Rspack will provide performance hints.
2310
+ * @default 307200 (300 KiB)
2286
2311
  */
2287
2312
  maxAssetSize?: number;
2288
2313
  /**
2289
2314
  * Total size of an entry point (in bytes).
2290
- * @default 250000
2315
+ * @default 512000 (500 KiB)
2291
2316
  */
2292
2317
  maxEntrypointSize?: number;
2293
2318
  };
package/dist/exports.d.ts CHANGED
@@ -57,9 +57,11 @@ export { LoaderOptionsPlugin } from './lib/LoaderOptionsPlugin';
57
57
  export { LoaderTargetPlugin } from './lib/LoaderTargetPlugin';
58
58
  export type { OutputFileSystem, WatchFileSystem } from './util/fs';
59
59
  import { FetchCompileAsyncWasmPlugin, lazyCompilationMiddleware, rsc, SubresourceIntegrityPlugin } from './builtin-plugin';
60
+ import JsonpTemplatePlugin from './web/JsonpTemplatePlugin';
60
61
  export { SubresourceIntegrityPlugin };
61
62
  interface Web {
62
63
  FetchCompileAsyncWasmPlugin: typeof FetchCompileAsyncWasmPlugin;
64
+ JsonpTemplatePlugin: typeof JsonpTemplatePlugin;
63
65
  }
64
66
  export declare const web: Web;
65
67
  import { NodeTargetPlugin } from './builtin-plugin';
@@ -98,7 +100,7 @@ interface JavaScript {
98
100
  JavascriptModulesPlugin: typeof JavascriptModulesPlugin;
99
101
  }
100
102
  export declare const javascript: JavaScript;
101
- import { WebWorkerTemplatePlugin } from './builtin-plugin';
103
+ import WebWorkerTemplatePlugin from './webworker/WebWorkerTemplatePlugin';
102
104
  interface Webworker {
103
105
  WebWorkerTemplatePlugin: typeof WebWorkerTemplatePlugin;
104
106
  }
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*! LICENSE: index.js.LICENSE.txt */
2
- import rspack_wasi_browser, { AsyncDependenciesBlock, BuiltinPluginName as external_rspack_wasi_browser_js_BuiltinPluginName, CIRCULAR_CONNECTION_SYMBOL, Chunk, ChunkGraph, Chunks as external_rspack_wasi_browser_js_Chunks, ConcatenatedModule, ContextModule, Dependency, EnforceExtension, EntryDependency, ExternalModule, JsCoordinator, JsLoaderState, JsRspackSeverity, Module, ModuleGraphConnection, NormalModule, RawRuleSetConditionType, RegisterJsTapKind, ResolverFactory as external_rspack_wasi_browser_js_ResolverFactory, TRANSITIVE_ONLY_SYMBOL, async as external_rspack_wasi_browser_js_async, cleanupGlobalTrace, formatDiagnostic, registerGlobalTrace, sync, syncTraceEvent, transformSync as external_rspack_wasi_browser_js_transformSync } from "./rspack.wasi-browser.js";
2
+ import rspack_wasi_browser, { AsyncDependenciesBlock, BuiltinPluginName as external_rspack_wasi_browser_js_BuiltinPluginName, Chunk, ChunkGraph, Chunks as external_rspack_wasi_browser_js_Chunks, ConcatenatedModule, ContextModule, Dependency, EnforceExtension, EntryDependency, ExternalModule, JsCoordinator, JsLoaderState, JsRspackSeverity, Module, ModuleGraphConnection, NormalModule, RawRuleSetConditionType, RegisterJsTapKind, ResolverFactory as external_rspack_wasi_browser_js_ResolverFactory, async as external_rspack_wasi_browser_js_async, cleanupGlobalTrace, formatDiagnostic, registerGlobalTrace, sync, syncTraceEvent, transformSync as external_rspack_wasi_browser_js_transformSync } from "./rspack.wasi-browser.js";
3
3
  import { AsyncParallelHook, AsyncSeriesBailHook, HookMap, SyncBailHook, SyncHook, SyncWaterfallHook } from "@rspack/lite-tapable";
4
4
  import * as __rspack_external__rspack_wasi_browser_js_bd433424 from "./rspack.wasi-browser.js";
5
5
  import * as __rspack_external__rspack_lite_tapable_c6bdf810 from "@rspack/lite-tapable";
@@ -2485,7 +2485,6 @@ __webpack_require__.add({
2485
2485
  if (y < x) return 1;
2486
2486
  return 0;
2487
2487
  }
2488
- var ONLY_ENUMERABLE = void 0;
2489
2488
  var kStrict = true;
2490
2489
  var kLoose = false;
2491
2490
  var kNoIterator = 0;
@@ -2535,8 +2534,8 @@ __webpack_require__.add({
2535
2534
  if (val1Tag !== val2Tag) return false;
2536
2535
  if (Array.isArray(val1)) {
2537
2536
  if (val1.length !== val2.length) return false;
2538
- var keys1 = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);
2539
- var keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);
2537
+ var keys1 = getOwnNonIndexProperties(val1);
2538
+ var keys2 = getOwnNonIndexProperties(val2);
2540
2539
  if (keys1.length !== keys2.length) return false;
2541
2540
  return keyCheck(val1, val2, strict, memos, kIsArray, keys1);
2542
2541
  }
@@ -2553,8 +2552,8 @@ __webpack_require__.add({
2553
2552
  if (!strict && (isFloat32Array(val1) || isFloat64Array(val1))) {
2554
2553
  if (!areSimilarFloatArrays(val1, val2)) return false;
2555
2554
  } else if (!areSimilarTypedArrays(val1, val2)) return false;
2556
- var _keys = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);
2557
- var _keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);
2555
+ var _keys = getOwnNonIndexProperties(val1);
2556
+ var _keys2 = getOwnNonIndexProperties(val2);
2558
2557
  if (_keys.length !== _keys2.length) return false;
2559
2558
  return keyCheck(val1, val2, strict, memos, kNoIterator, _keys);
2560
2559
  } else if (isSet(val1)) {
@@ -17867,7 +17866,7 @@ __webpack_require__.add({
17867
17866
  var c0_lo = hl;
17868
17867
  var c1_hi = s1_512_hi(eh, el);
17869
17868
  var c1_lo = s1_512_lo(eh, el);
17870
- var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl);
17869
+ var c2_hi = ch64_hi(eh, el, fh, fl, gh);
17871
17870
  var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl);
17872
17871
  var c3_hi = this.k[i];
17873
17872
  var c3_lo = this.k[i + 1];
@@ -17877,7 +17876,7 @@ __webpack_require__.add({
17877
17876
  var T1_lo = sum64_5_lo(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo, c4_hi, c4_lo);
17878
17877
  c0_hi = s0_512_hi(ah, al);
17879
17878
  c0_lo = s0_512_lo(ah, al);
17880
- c1_hi = maj64_hi(ah, al, bh, bl, ch, cl);
17879
+ c1_hi = maj64_hi(ah, al, bh, bl, ch);
17881
17880
  c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);
17882
17881
  var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo);
17883
17882
  var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);
@@ -35360,7 +35359,7 @@ __webpack_require__.add({
35360
35359
  __webpack_require__.d(__webpack_exports__, {
35361
35360
  Buffer: ()=>_napi_rs_wasm_runtime_fs__rspack_import_0.hp
35362
35361
  });
35363
- var _napi_rs_wasm_runtime_fs__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.1.2_@emnapi+core@1.9.2_@emnapi+runtime@1.9.2/node_modules/@napi-rs/wasm-runtime/dist/fs.js");
35362
+ var _napi_rs_wasm_runtime_fs__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.1.3_@emnapi+core@1.9.2_@emnapi+runtime@1.9.2/node_modules/@napi-rs/wasm-runtime/dist/fs.js");
35364
35363
  },
35365
35364
  "./src/browser/fs.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
35366
35365
  __webpack_require__.r(__webpack_exports__);
@@ -35376,15 +35375,15 @@ __webpack_require__.add({
35376
35375
  volume: ()=>volume,
35377
35376
  watch: ()=>watch
35378
35377
  });
35379
- var _napi_rs_wasm_runtime_fs__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.1.2_@emnapi+core@1.9.2_@emnapi+runtime@1.9.2/node_modules/@napi-rs/wasm-runtime/dist/fs.js");
35380
- var _rspack_binding__rspack_import_1 = __webpack_require__("@rspack/binding?81b3");
35378
+ var _napi_rs_wasm_runtime_fs__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.1.3_@emnapi+core@1.9.2_@emnapi+runtime@1.9.2/node_modules/@napi-rs/wasm-runtime/dist/fs.js");
35379
+ var _rspack_binding__rspack_import_1 = __webpack_require__("@rspack/binding?f5f3");
35381
35380
  const fs = _rspack_binding__rspack_import_1.__fs;
35382
35381
  const volume = _rspack_binding__rspack_import_1.__volume;
35383
35382
  const memfs = _napi_rs_wasm_runtime_fs__rspack_import_0.tO;
35384
35383
  const { readFileSync, readdirSync, lstat, existsSync, readdir, watch } = fs;
35385
35384
  const __rspack_default_export = fs;
35386
35385
  },
35387
- "@rspack/binding?81b3" (module) {
35386
+ "@rspack/binding?f5f3" (module) {
35388
35387
  module.exports = __rspack_external__rspack_wasi_browser_js_bd433424;
35389
35388
  },
35390
35389
  "?7763" () {},
@@ -35404,7 +35403,7 @@ __webpack_require__.add({
35404
35403
  return out;
35405
35404
  };
35406
35405
  },
35407
- "../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.1.2_@emnapi+core@1.9.2_@emnapi+runtime@1.9.2/node_modules/@napi-rs/wasm-runtime/dist/fs.js" (__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
35406
+ "../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.1.3_@emnapi+core@1.9.2_@emnapi+runtime@1.9.2/node_modules/@napi-rs/wasm-runtime/dist/fs.js" (__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
35408
35407
  __webpack_require__.d(__webpack_exports__, {
35409
35408
  hp: ()=>Buffer,
35410
35409
  tO: ()=>memfs
@@ -38551,7 +38550,7 @@ __webpack_require__.add({
38551
38550
  const getgid = ()=>process_1.default.getgid?.() ?? 0;
38552
38551
  const EMPTY_BUFFER = (0, buffer_1.bufferAllocUnsafe)(0);
38553
38552
  let Node$1 = class {
38554
- constructor(ino, mode = 0o666){
38553
+ constructor(ino, mode = 0o666, uid = getuid(), gid = getgid()){
38555
38554
  this.changes = new fanout_1.FanOut();
38556
38555
  this._uid = getuid();
38557
38556
  this._gid = getgid();
@@ -38565,6 +38564,8 @@ __webpack_require__.add({
38565
38564
  this._nlink = 1;
38566
38565
  this.mode = mode;
38567
38566
  this.ino = ino;
38567
+ this._uid = uid;
38568
+ this._gid = gid;
38568
38569
  }
38569
38570
  set ctime(ctime) {
38570
38571
  this._ctime = ctime;
@@ -42012,17 +42013,17 @@ __webpack_require__.add({
42012
42013
  const pathJoin = path_1.posix ? path_1.posix.join : path_1.join;
42013
42014
  const { O_RDONLY, O_WRONLY, O_RDWR, O_CREAT, O_EXCL, O_TRUNC, O_APPEND, O_DIRECTORY } = fs_node_utils_1.constants;
42014
42015
  let Superblock$1 = class Superblock {
42015
- static fromJSON(json, cwd) {
42016
- const vol = new Superblock();
42016
+ static fromJSON(json, cwd, opts) {
42017
+ const vol = new Superblock(opts);
42017
42018
  vol.fromJSON(json, cwd);
42018
42019
  return vol;
42019
42020
  }
42020
- static fromNestedJSON(json, cwd) {
42021
- const vol = new Superblock();
42021
+ static fromNestedJSON(json, cwd, opts) {
42022
+ const vol = new Superblock(opts);
42022
42023
  vol.fromNestedJSON(json, cwd);
42023
42024
  return vol;
42024
42025
  }
42025
- constructor(props = {}){
42026
+ constructor(opts = {}){
42026
42027
  this.ino = 0;
42027
42028
  this.inodes = {};
42028
42029
  this.releasedInos = [];
@@ -42204,6 +42205,7 @@ __webpack_require__.add({
42204
42205
  const file = this.getFileByFdOrThrow(fd, 'close');
42205
42206
  this.closeFile(file);
42206
42207
  };
42208
+ this.process = opts.process ?? process_1.default;
42207
42209
  const root = this.createLink();
42208
42210
  root.setNode(this.createNode(0o777 | fs_node_utils_1.constants.S_IFDIR));
42209
42211
  root.setChild('.', root);
@@ -42240,7 +42242,9 @@ __webpack_require__.add({
42240
42242
  return 'number' == typeof releasedFd ? releasedFd : Superblock.fd--;
42241
42243
  }
42242
42244
  createNode(mode) {
42243
- const node = new Node_1.Node(this.newInoNumber(), mode);
42245
+ const uid = this.process.getuid?.() ?? 0;
42246
+ const gid = this.process.getgid?.() ?? 0;
42247
+ const node = new Node_1.Node(this.newInoNumber(), mode, uid, gid);
42244
42248
  this.inodes[node.ino] = node;
42245
42249
  return node;
42246
42250
  }
@@ -42264,10 +42268,12 @@ __webpack_require__.add({
42264
42268
  }
42265
42269
  let curr = this.root;
42266
42270
  let i = 0;
42271
+ const uid = this.process.getuid?.() ?? 0;
42272
+ const gid = this.process.getgid?.() ?? 0;
42267
42273
  while(i < steps.length){
42268
42274
  let node = curr.getNode();
42269
42275
  if (node.isDirectory()) {
42270
- if (checkAccess && !node.canExecute()) return (0, result_1.Err)((0, util_1.createStatError)("EACCES", funcName, filename));
42276
+ if (checkAccess && !node.canExecute(uid, gid)) return (0, result_1.Err)((0, util_1.createStatError)("EACCES", funcName, filename));
42271
42277
  } else if (i < steps.length - 1) return (0, result_1.Err)((0, util_1.createStatError)("ENOTDIR", funcName, filename));
42272
42278
  curr = curr.getChild(steps[i]) ?? null;
42273
42279
  if (!curr) if (checkExistence) return (0, result_1.Err)((0, util_1.createStatError)("ENOENT", funcName, filename));
@@ -42281,7 +42287,7 @@ __webpack_require__.add({
42281
42287
  continue;
42282
42288
  }
42283
42289
  if (checkExistence && !node.isDirectory() && i < steps.length - 1) {
42284
- const errorCode = 'win32' === process_1.default.platform ? "ENOENT" : "ENOTDIR";
42290
+ const errorCode = 'win32' === this.process.platform ? "ENOENT" : "ENOTDIR";
42285
42291
  return (0, result_1.Err)((0, util_1.createStatError)(errorCode, funcName, filename));
42286
42292
  }
42287
42293
  i++;
@@ -42385,7 +42391,7 @@ __webpack_require__.add({
42385
42391
  for (const link of links)this._toJSON(link, json, isRelative ? link.getPath() : '', asBuffer);
42386
42392
  return json;
42387
42393
  }
42388
- fromJSON(json, cwd = process_1.default.cwd()) {
42394
+ fromJSON(json, cwd = this.process.cwd()) {
42389
42395
  for(let filename in json){
42390
42396
  const data = json[filename];
42391
42397
  filename = (0, util_1.resolve)(filename, cwd);
@@ -52126,8 +52132,9 @@ __webpack_require__.add({
52126
52132
  });
52127
52133
  results.push(...dirResults.map((r)=>path_1.posix.resolve(dir, r)));
52128
52134
  } else {
52135
+ const normalizedPattern = pattern.replace(/^\.\//, '');
52129
52136
  const dirResults = walkDirectory(fs, resolvedCwd, [
52130
- pattern
52137
+ normalizedPattern
52131
52138
  ], globOptions);
52132
52139
  results.push(...dirResults);
52133
52140
  }
@@ -53300,8 +53307,8 @@ __webpack_require__.add({
53300
53307
  }
53301
53308
  }
53302
53309
  volume.Volume = Volume;
53303
- Volume.fromJSON = (json, cwd)=>new Volume(fs_core_1.Superblock.fromJSON(json, cwd));
53304
- Volume.fromNestedJSON = (json, cwd)=>new Volume(fs_core_1.Superblock.fromNestedJSON(json, cwd));
53310
+ Volume.fromJSON = (json, cwd, opts)=>new Volume(fs_core_1.Superblock.fromJSON(json, cwd, opts));
53311
+ Volume.fromNestedJSON = (json, cwd, opts)=>new Volume(fs_core_1.Superblock.fromNestedJSON(json, cwd, opts));
53305
53312
  function emitStop(self1) {
53306
53313
  self1.emit('stop');
53307
53314
  }
@@ -53358,6 +53365,7 @@ __webpack_require__.add({
53358
53365
  if (void 0 === options.highWaterMark) options.highWaterMark = 65536;
53359
53366
  stream_1.Readable.call(this, options);
53360
53367
  this.path = (0, util_3.pathToFilename)(path);
53368
+ this._fileHandle = options.fd && 'number' != typeof options.fd ? options.fd : null;
53361
53369
  this.fd = void 0 === options.fd ? null : 'number' != typeof options.fd ? options.fd.fd : options.fd;
53362
53370
  this.flags = void 0 === options.flags ? 'r' : options.flags;
53363
53371
  this.mode = void 0 === options.mode ? 0o666 : options.mode;
@@ -53437,7 +53445,8 @@ __webpack_require__.add({
53437
53445
  }
53438
53446
  if ('boolean' == typeof this._readableState?.closed) this._readableState.closed = true;
53439
53447
  else this.closed = true;
53440
- this._vol.close(this.fd, (er)=>{
53448
+ if (this._fileHandle) this._fileHandle.close().then(()=>this.emit('close'), (er)=>this.emit('error', er));
53449
+ else this._vol.close(this.fd, (er)=>{
53441
53450
  if (er) this.emit('error', er);
53442
53451
  else this.emit('close');
53443
53452
  });
@@ -53454,6 +53463,7 @@ __webpack_require__.add({
53454
53463
  options = Object.assign({}, (0, options_1.getOptions)(options, {}));
53455
53464
  stream_1.Writable.call(this, options);
53456
53465
  this.path = (0, util_3.pathToFilename)(path);
53466
+ this._fileHandle = options.fd && 'number' != typeof options.fd ? options.fd : null;
53457
53467
  this.fd = void 0 === options.fd ? null : 'number' != typeof options.fd ? options.fd.fd : options.fd;
53458
53468
  this.flags = void 0 === options.flags ? 'w' : options.flags;
53459
53469
  this.mode = void 0 === options.mode ? 0o666 : options.mode;
@@ -53533,7 +53543,8 @@ __webpack_require__.add({
53533
53543
  }
53534
53544
  if ('boolean' == typeof this._writableState?.closed) this._writableState.closed = true;
53535
53545
  else this.closed = true;
53536
- this._vol.close(this.fd, (er)=>{
53546
+ if (this._fileHandle) this._fileHandle.close().then(()=>this.emit('close'), (er)=>this.emit('error', er));
53547
+ else this._vol.close(this.fd, (er)=>{
53537
53548
  if (er) this.emit('error', er);
53538
53549
  else this.emit('close');
53539
53550
  });
@@ -53941,8 +53952,14 @@ __webpack_require__.add({
53941
53952
  return fs;
53942
53953
  }
53943
53954
  exports$1.fs = createFsFromVolume(exports$1.vol);
53944
- const memfs = (json = {}, cwd = '/')=>{
53945
- const vol = fs_node_1.Volume.fromNestedJSON(json, cwd);
53955
+ const memfs = (json = {}, cwdOrOpts = '/')=>{
53956
+ const opts = 'string' == typeof cwdOrOpts ? {
53957
+ cwd: cwdOrOpts
53958
+ } : cwdOrOpts;
53959
+ const cwd = opts.cwd ?? (opts.process ? void 0 : '/');
53960
+ const vol = fs_node_1.Volume.fromNestedJSON(json, cwd, {
53961
+ process: opts.process
53962
+ });
53946
53963
  const fs = createFsFromVolume(vol);
53947
53964
  return {
53948
53965
  fs,
@@ -55417,11 +55434,28 @@ function createDiagnosticArray(adm) {
55417
55434
  adm[$proxy] = proxy;
55418
55435
  return proxy;
55419
55436
  }
55420
- var _computedKey, _computedKey1, _computedKey2;
55437
+ function _to_primitive(input, hint) {
55438
+ if ("object" !== _type_of(input) || null === input) return input;
55439
+ var prim = input[Symbol.toPrimitive];
55440
+ if (void 0 !== prim) {
55441
+ var res = prim.call(input, hint || "default");
55442
+ if ("object" !== _type_of(res)) return res;
55443
+ throw new TypeError("@@toPrimitive must return a primitive value.");
55444
+ }
55445
+ return ("string" === hint ? String : Number)(input);
55446
+ }
55447
+ function _to_property_key(arg) {
55448
+ var key = _to_primitive(arg, "string");
55449
+ return "symbol" === _type_of(key) ? key : String(key);
55450
+ }
55451
+ function _type_of(obj) {
55452
+ return obj && "u" > typeof Symbol && obj.constructor === Symbol ? "symbol" : typeof obj;
55453
+ }
55454
+ let _computedKey, _computedKey1, _computedKey2;
55421
55455
  const checkCompilation = (compilation)=>{
55422
55456
  if (!(compilation instanceof Compilation)) throw new TypeError('The \'compilation\' argument must be an instance of Compilation. This usually occurs when multiple versions of "@rspack/core" are used, or when the code in "@rspack/core" is executed multiple times.');
55423
55457
  };
55424
- _computedKey = rspack_wasi_browser.COMPILATION_HOOKS_MAP_SYMBOL;
55458
+ _computedKey = _to_property_key(rspack_wasi_browser.COMPILATION_HOOKS_MAP_SYMBOL);
55425
55459
  class Compilation {
55426
55460
  #inner;
55427
55461
  #shutdown;
@@ -56045,7 +56079,7 @@ class EntryData {
56045
56079
  this.options = binding.options;
56046
56080
  }
56047
56081
  }
56048
- _computedKey1 = Symbol.iterator, _computedKey2 = Symbol.toStringTag;
56082
+ _computedKey1 = _to_property_key(Symbol.iterator), _computedKey2 = _to_property_key(Symbol.toStringTag);
56049
56083
  class Entries {
56050
56084
  #data;
56051
56085
  constructor(data){
@@ -56557,7 +56591,7 @@ function SplitChunksPlugin_toRawSplitChunksOptions(sc, compiler) {
56557
56591
  if ('function' == typeof chunks) return (chunk)=>chunks(chunk);
56558
56592
  return chunks;
56559
56593
  }
56560
- const { name, chunks, defaultSizeTypes, cacheGroups = {}, fallbackCacheGroup, minSize, minSizeReduction, maxSize, maxAsyncSize, maxInitialSize, ...passThrough } = sc;
56594
+ const { name, chunks, defaultSizeTypes, cacheGroups = {}, fallbackCacheGroup, minSize, minSizeReduction, enforceSizeThreshold, maxSize, maxAsyncSize, maxInitialSize, ...passThrough } = sc;
56561
56595
  return {
56562
56596
  name: getName(name),
56563
56597
  chunks: getChunks(chunks),
@@ -56566,7 +56600,7 @@ function SplitChunksPlugin_toRawSplitChunksOptions(sc, compiler) {
56566
56600
  'unknown'
56567
56601
  ],
56568
56602
  cacheGroups: Object.entries(cacheGroups).filter(([_key, group])=>false !== group).map(([key, group])=>{
56569
- const { test, name, chunks, minSize, minSizeReduction, maxSize, maxAsyncSize, maxInitialSize, ...passThrough } = group;
56603
+ const { test, name, chunks, minSize, minSizeReduction, enforceSizeThreshold, maxSize, maxAsyncSize, maxInitialSize, ...passThrough } = group;
56570
56604
  const rawGroup = {
56571
56605
  key,
56572
56606
  test: getTest(test),
@@ -56574,6 +56608,7 @@ function SplitChunksPlugin_toRawSplitChunksOptions(sc, compiler) {
56574
56608
  chunks: getChunks(chunks),
56575
56609
  minSize: JsSplitChunkSizes.__to_binding(minSize),
56576
56610
  minSizeReduction: JsSplitChunkSizes.__to_binding(minSizeReduction),
56611
+ enforceSizeThreshold: JsSplitChunkSizes.__to_binding(enforceSizeThreshold),
56577
56612
  maxSize: JsSplitChunkSizes.__to_binding(maxSize),
56578
56613
  maxAsyncSize: JsSplitChunkSizes.__to_binding(maxAsyncSize),
56579
56614
  maxInitialSize: JsSplitChunkSizes.__to_binding(maxInitialSize),
@@ -56587,6 +56622,7 @@ function SplitChunksPlugin_toRawSplitChunksOptions(sc, compiler) {
56587
56622
  },
56588
56623
  minSize: JsSplitChunkSizes.__to_binding(minSize),
56589
56624
  minSizeReduction: JsSplitChunkSizes.__to_binding(minSizeReduction),
56625
+ enforceSizeThreshold: JsSplitChunkSizes.__to_binding(enforceSizeThreshold),
56590
56626
  maxSize: JsSplitChunkSizes.__to_binding(maxSize),
56591
56627
  maxAsyncSize: JsSplitChunkSizes.__to_binding(maxAsyncSize),
56592
56628
  maxInitialSize: JsSplitChunkSizes.__to_binding(maxInitialSize),
@@ -58354,11 +58390,7 @@ async function runLoaders(compiler, context) {
58354
58390
  resource: resource
58355
58391
  }
58356
58392
  });
58357
- if (parallelism) result = await service_run(loaderName, {
58358
- loaderContext: getWorkerLoaderContext(),
58359
- loaderState,
58360
- args
58361
- }, getWorkerLoaderHandlers(), 'object' == typeof currentLoaderObject?.parallel ? currentLoaderObject.parallel : void 0) || [];
58393
+ if (parallelism) result = await service_run(getWorkerLoaderContext(), getWorkerLoaderHandlers(), 'object' == typeof currentLoaderObject?.parallel && currentLoaderObject.parallel) || [];
58362
58394
  else {
58363
58395
  if (loaderState === JsLoaderState.Normal) convertArgs(args, !!currentLoaderObject?.raw);
58364
58396
  result = await utils_runSyncOrAsync(fn, loaderContext, args) || [];
@@ -58663,15 +58695,15 @@ function tryMatch(payload, condition) {
58663
58695
  return false;
58664
58696
  }
58665
58697
  const getRawModuleRule = (rule, path, options, upperType)=>{
58666
- if (rule.loader) rule.use = [
58698
+ const normalizedUse = rule.loader ? [
58667
58699
  {
58668
58700
  loader: rule.loader,
58669
58701
  options: rule.options
58670
58702
  }
58671
- ];
58703
+ ] : rule.use;
58672
58704
  let funcUse;
58673
- if ('function' == typeof rule.use) {
58674
- const use = rule.use;
58705
+ if ('function' == typeof normalizedUse) {
58706
+ const use = normalizedUse;
58675
58707
  funcUse = (rawContext)=>{
58676
58708
  const context = {
58677
58709
  ...rawContext,
@@ -58702,7 +58734,7 @@ const getRawModuleRule = (rule, path, options, upperType)=>{
58702
58734
  scheme: rule.scheme ? getRawRuleSetCondition(rule.scheme) : void 0,
58703
58735
  mimetype: rule.mimetype ? getRawRuleSetCondition(rule.mimetype) : void 0,
58704
58736
  sideEffects: rule.sideEffects,
58705
- use: 'function' == typeof rule.use ? funcUse : createRawModuleRuleUses(rule.use ?? [], `${path}.use`, options),
58737
+ use: 'function' == typeof normalizedUse ? funcUse : createRawModuleRuleUses(normalizedUse ?? [], `${path}.use`, options),
58706
58738
  type: rule.type,
58707
58739
  layer: rule.layer,
58708
58740
  parser: rule.parser ? getRawParserOptions(rule.parser, rule.type ?? upperType) : void 0,
@@ -60000,13 +60032,6 @@ const SwcJsMinimizerRspackPlugin = base_create(external_rspack_wasi_browser_js_B
60000
60032
  };
60001
60033
  }, 'compilation');
60002
60034
  const URLPlugin = base_create(external_rspack_wasi_browser_js_BuiltinPluginName.URLPlugin, ()=>{}, 'compilation');
60003
- class WebWorkerTemplatePlugin extends RspackBuiltinPlugin {
60004
- name = external_rspack_wasi_browser_js_BuiltinPluginName.WebWorkerTemplatePlugin;
60005
- raw(compiler) {
60006
- compiler.options.output.chunkLoading = "import-scripts";
60007
- return createBuiltinPlugin(this.name, void 0);
60008
- }
60009
- }
60010
60035
  class WorkerPlugin extends RspackBuiltinPlugin {
60011
60036
  chunkLoading;
60012
60037
  wasmLoading;
@@ -60248,7 +60273,8 @@ const _cleverMerge = (first, second, internalCaching = false)=>{
60248
60273
  const { static: firstInfo, dynamic: firstDynamicInfo } = firstObject;
60249
60274
  let secondObj = second;
60250
60275
  if (void 0 !== firstDynamicInfo) {
60251
- let { byProperty, fn } = firstDynamicInfo;
60276
+ let { fn } = firstDynamicInfo;
60277
+ const { byProperty } = firstDynamicInfo;
60252
60278
  const fnInfo = fn[DYNAMIC_INFO];
60253
60279
  if (fnInfo) {
60254
60280
  secondObj = internalCaching ? cachedCleverMerge(fnInfo[1], second) : cleverMerge(fnInfo[1], second);
@@ -61330,6 +61356,7 @@ const mergeTargetProperties = (targetProperties)=>{
61330
61356
  };
61331
61357
  const getTargetsProperties = (targets, context)=>mergeTargetProperties(targets.map((t)=>getTargetProperties(t, context)));
61332
61358
  var defaults_process = __webpack_require__("../../node_modules/.pnpm/process@0.11.10/node_modules/process/browser.js");
61359
+ const ERROR_PREFIX = 'Invalid Rspack configuration:';
61333
61360
  const applyRspackOptionsDefaults = (options)=>{
61334
61361
  F(options, 'context', ()=>defaults_process.cwd());
61335
61362
  F(options, 'target', ()=>getDefaultTarget(options.context));
@@ -61741,6 +61768,10 @@ const applyOutputDefaults = (options, { context, targetProperties: tp, isAffecte
61741
61768
  D(output, 'assetModuleFilename', '[hash][ext][query]');
61742
61769
  D(output, 'webassemblyModuleFilename', '[hash].module.wasm');
61743
61770
  D(output, 'compareBeforeEmit', true);
61771
+ if (output.path && !path_browserify_default().isAbsolute(output.path)) {
61772
+ if (!context) throw new Error(`${ERROR_PREFIX} "context" must be a non-empty absolute path when "output.path" is relative, get "${context ?? ''}".`);
61773
+ output.path = path_browserify_default().resolve(context, output.path);
61774
+ }
61744
61775
  F(output, 'path', ()=>path_browserify_default().join(defaults_process.cwd(), 'dist'));
61745
61776
  F(output, 'pathinfo', ()=>false);
61746
61777
  D(output, 'publicPath', tp && (tp.document || tp.importScripts) ? 'auto' : '');
@@ -61851,7 +61882,7 @@ const applyOutputDefaults = (options, { context, targetProperties: tp, isAffecte
61851
61882
  });
61852
61883
  D(output, 'bundlerInfo', {});
61853
61884
  if ('object' == typeof output.bundlerInfo) {
61854
- D(output.bundlerInfo, 'version', "2.0.0-rc.1");
61885
+ D(output.bundlerInfo, 'version', "2.0.0-rc.3");
61855
61886
  D(output.bundlerInfo, 'bundler', 'rspack');
61856
61887
  D(output.bundlerInfo, 'force', false);
61857
61888
  }
@@ -61899,8 +61930,8 @@ const applyNodeDefaults = (node, { outputModule, targetProperties })=>{
61899
61930
  };
61900
61931
  const applyPerformanceDefaults = (performance, { production })=>{
61901
61932
  if (false === performance) return;
61902
- D(performance, 'maxAssetSize', 250000);
61903
- D(performance, 'maxEntrypointSize', 250000);
61933
+ D(performance, 'maxAssetSize', 307200);
61934
+ D(performance, 'maxEntrypointSize', 512000);
61904
61935
  F(performance, 'hints', ()=>production ? 'warning' : false);
61905
61936
  };
61906
61937
  const applyOptimizationDefaults = (optimization, { production, development })=>{
@@ -61949,6 +61980,7 @@ const applyOptimizationDefaults = (optimization, { production, development })=>{
61949
61980
  D(splitChunks, 'usedExports', true === optimization.usedExports);
61950
61981
  D(splitChunks, 'minChunks', 1);
61951
61982
  F(splitChunks, 'minSize', ()=>production ? 20000 : 10000);
61983
+ F(splitChunks, 'enforceSizeThreshold', ()=>production ? 50000 : 30000);
61952
61984
  F(splitChunks, 'maxAsyncRequests', ()=>production ? 30 : 1 / 0);
61953
61985
  F(splitChunks, 'maxInitialRequests', ()=>production ? 30 : 1 / 0);
61954
61986
  D(splitChunks, 'automaticNameDelimiter', '-');
@@ -63508,7 +63540,7 @@ class MultiStats {
63508
63540
  return obj;
63509
63541
  });
63510
63542
  if (childOptions.version) {
63511
- obj.rspackVersion = "2.0.0-rc.1";
63543
+ obj.rspackVersion = "2.0.0-rc.3";
63512
63544
  obj.version = "5.75.0";
63513
63545
  }
63514
63546
  if (childOptions.hash) obj.hash = obj.children.map((j)=>j.hash).join('');
@@ -63623,8 +63655,25 @@ class MultiWatching {
63623
63655
  }
63624
63656
  }
63625
63657
  const src_MultiWatching = MultiWatching;
63626
- var ArrayQueue_computedKey;
63627
- ArrayQueue_computedKey = Symbol.iterator;
63658
+ function ArrayQueue_to_primitive(input, hint) {
63659
+ if ("object" !== ArrayQueue_type_of(input) || null === input) return input;
63660
+ var prim = input[Symbol.toPrimitive];
63661
+ if (void 0 !== prim) {
63662
+ var res = prim.call(input, hint || "default");
63663
+ if ("object" !== ArrayQueue_type_of(res)) return res;
63664
+ throw new TypeError("@@toPrimitive must return a primitive value.");
63665
+ }
63666
+ return ("string" === hint ? String : Number)(input);
63667
+ }
63668
+ function ArrayQueue_to_property_key(arg) {
63669
+ var key = ArrayQueue_to_primitive(arg, "string");
63670
+ return "symbol" === ArrayQueue_type_of(key) ? key : String(key);
63671
+ }
63672
+ function ArrayQueue_type_of(obj) {
63673
+ return obj && "u" > typeof Symbol && obj.constructor === Symbol ? "symbol" : typeof obj;
63674
+ }
63675
+ let ArrayQueue_computedKey;
63676
+ ArrayQueue_computedKey = ArrayQueue_to_property_key(Symbol.iterator);
63628
63677
  class ArrayQueue {
63629
63678
  _list;
63630
63679
  _listReversed;
@@ -65194,7 +65243,7 @@ const SIMPLE_EXTRACTORS = {
65194
65243
  },
65195
65244
  version: (object)=>{
65196
65245
  object.version = "5.75.0";
65197
- object.rspackVersion = "2.0.0-rc.1";
65246
+ object.rspackVersion = "2.0.0-rc.3";
65198
65247
  },
65199
65248
  env: (object, _compilation, _context, { _env })=>{
65200
65249
  object.env = _env;
@@ -66858,17 +66907,14 @@ class RspackOptionsApply {
66858
66907
  compiler.hooks.afterResolvers.call(compiler);
66859
66908
  }
66860
66909
  }
66861
- const ERROR_PREFIX = 'Invalid Rspack configuration:';
66910
+ const validateConfig_ERROR_PREFIX = 'Invalid Rspack configuration:';
66862
66911
  const validateContext = ({ context })=>{
66863
- if (context && !(0, path_browserify.isAbsolute)(context)) throw new Error(`${ERROR_PREFIX} "context" must be an absolute path, get "${context}".`);
66864
- };
66865
- const validateOutputPath = ({ output })=>{
66866
- if (output?.path && !(0, path_browserify.isAbsolute)(output.path)) throw new Error(`${ERROR_PREFIX} "output.path" must be an absolute path, get "${output.path}".`);
66912
+ if (context && !(0, path_browserify.isAbsolute)(context)) throw new Error(`${validateConfig_ERROR_PREFIX} "context" must be an absolute path, get "${context}".`);
66867
66913
  };
66868
66914
  const validateSplitChunks = ({ optimization })=>{
66869
66915
  if (optimization?.splitChunks) {
66870
66916
  const { minChunks } = optimization.splitChunks;
66871
- if (void 0 !== minChunks && minChunks < 1) throw new Error(`${ERROR_PREFIX} "optimization.splitChunks.minChunks" must be greater than or equal to 1, get \`${minChunks}\`.`);
66917
+ if (void 0 !== minChunks && minChunks < 1) throw new Error(`${validateConfig_ERROR_PREFIX} "optimization.splitChunks.minChunks" must be greater than or equal to 1, get \`${minChunks}\`.`);
66872
66918
  }
66873
66919
  };
66874
66920
  const validateExternalUmd = ({ output, externals, externalsType })=>{
@@ -66887,14 +66933,13 @@ const validateExternalUmd = ({ output, externals, externalsType })=>{
66887
66933
  'commonjs2',
66888
66934
  'amd'
66889
66935
  ];
66890
- if (requiredKeys.some((key)=>void 0 === value[key])) throw new Error(`${ERROR_PREFIX} External object must have "root", "commonjs", "commonjs2", "amd" properties when "libraryType" or "externalsType" is "umd", get: ${JSON.stringify(value, null, 2)}.`);
66936
+ if (requiredKeys.some((key)=>void 0 === value[key])) throw new Error(`${validateConfig_ERROR_PREFIX} External object must have "root", "commonjs", "commonjs2", "amd" properties when "libraryType" or "externalsType" is "umd", get: ${JSON.stringify(value, null, 2)}.`);
66891
66937
  };
66892
66938
  if (Array.isArray(externals)) externals.forEach((external)=>checkExternalItem(external));
66893
66939
  else checkExternalItem(externals);
66894
66940
  };
66895
66941
  function validateRspackConfig(config) {
66896
66942
  validateContext(config);
66897
- validateOutputPath(config);
66898
66943
  validateSplitChunks(config);
66899
66944
  validateExternalUmd(config);
66900
66945
  }
@@ -67261,7 +67306,7 @@ const createCompilationHooksRegisters = (getCompiler, createTap, createMapTap)=>
67261
67306
  return 'function' == typeof value ? value.bind(target) : value;
67262
67307
  },
67263
67308
  set (_target, prop, value) {
67264
- if ('id' === prop && null !== value) {
67309
+ if ('id' === prop && ('string' == typeof value || 'number' == typeof value)) {
67265
67310
  assignments.set(m.identifier, value);
67266
67311
  return true;
67267
67312
  }
@@ -67271,10 +67316,7 @@ const createCompilationHooksRegisters = (getCompiler, createTap, createMapTap)=>
67271
67316
  });
67272
67317
  queried.call(proxiedModules);
67273
67318
  return {
67274
- assignments: Object.fromEntries(Array.from(assignments.entries()).map(([k, v])=>[
67275
- k,
67276
- String(v)
67277
- ]))
67319
+ assignments: Object.fromEntries(assignments.entries())
67278
67320
  };
67279
67321
  };
67280
67322
  }),
@@ -68440,7 +68482,7 @@ class Compiler {
68440
68482
  const rawOptions = getRawOptions(options, this);
68441
68483
  rawOptions.__references = Object.fromEntries(this.#ruleSet.builtinReferences.entries());
68442
68484
  rawOptions.__virtual_files = VirtualModulesPlugin.__internal__take_virtual_files(this);
68443
- const instanceBinding = __webpack_require__("@rspack/binding?81b3");
68485
+ const instanceBinding = __webpack_require__("@rspack/binding?f5f3");
68444
68486
  this.#registers = this.#createHooksRegisters();
68445
68487
  const inputFileSystem = this.inputFileSystem && ThreadsafeInputNodeFS.needsBinding(options.experiments.useInputFileSystem) ? ThreadsafeInputNodeFS.__to_binding(this.inputFileSystem) : void 0;
68446
68488
  try {
@@ -68459,14 +68501,14 @@ class Compiler {
68459
68501
  const createTap = this.#createHookRegisterTaps.bind(this);
68460
68502
  const createMapTap = this.#createHookMapRegisterTaps.bind(this);
68461
68503
  return {
68462
- ...createCompilerHooksRegisters(getCompiler, createTap, createMapTap),
68504
+ ...createCompilerHooksRegisters(getCompiler, createTap),
68463
68505
  ...createCompilationHooksRegisters(getCompiler, createTap, createMapTap),
68464
68506
  ...createNormalModuleFactoryHooksRegisters(getCompiler, createTap, createMapTap),
68465
- ...createContextModuleFactoryHooksRegisters(getCompiler, createTap, createMapTap),
68466
- ...createJavaScriptModulesHooksRegisters(getCompiler, createTap, createMapTap),
68467
- ...createHtmlPluginHooksRegisters(getCompiler, createTap, createMapTap),
68468
- ...createRuntimePluginHooksRegisters(getCompiler, createTap, createMapTap),
68469
- ...createRsdoctorPluginHooksRegisters(getCompiler, createTap, createMapTap)
68507
+ ...createContextModuleFactoryHooksRegisters(getCompiler, createTap),
68508
+ ...createJavaScriptModulesHooksRegisters(getCompiler, createTap),
68509
+ ...createHtmlPluginHooksRegisters(getCompiler, createTap),
68510
+ ...createRuntimePluginHooksRegisters(getCompiler, createTap),
68511
+ ...createRsdoctorPluginHooksRegisters(getCompiler, createTap)
68470
68512
  };
68471
68513
  }
68472
68514
  #updateNonSkippableRegisters() {
@@ -68650,11 +68692,11 @@ Object.defineProperty(rspack_wasi_browser.ExternalModule.prototype, 'emitFile',
68650
68692
  const ModuleGraphConnection_ModuleGraphConnection = ModuleGraphConnection;
68651
68693
  Object.defineProperties(ModuleGraphConnection_ModuleGraphConnection, {
68652
68694
  TRANSITIVE_ONLY: {
68653
- value: TRANSITIVE_ONLY_SYMBOL,
68695
+ value: rspack_wasi_browser.TRANSITIVE_ONLY_SYMBOL,
68654
68696
  enumerable: true
68655
68697
  },
68656
68698
  CIRCULAR_CONNECTION: {
68657
- value: CIRCULAR_CONNECTION_SYMBOL,
68699
+ value: rspack_wasi_browser.CIRCULAR_CONNECTION_SYMBOL,
68658
68700
  enumerable: true
68659
68701
  }
68660
68702
  });
@@ -68826,6 +68868,13 @@ class LoaderTargetPlugin {
68826
68868
  });
68827
68869
  }
68828
68870
  }
68871
+ class JsonpTemplatePlugin {
68872
+ apply(compiler) {
68873
+ compiler.options.output.chunkLoading = 'jsonp';
68874
+ new ArrayPushCallbackChunkFormatPlugin().apply(compiler);
68875
+ new EnableChunkLoadingPlugin('jsonp').apply(compiler);
68876
+ }
68877
+ }
68829
68878
  class NodeTemplatePlugin {
68830
68879
  _options;
68831
68880
  constructor(_options = {}){
@@ -68838,6 +68887,13 @@ class NodeTemplatePlugin {
68838
68887
  new EnableChunkLoadingPlugin(chunkLoading).apply(compiler);
68839
68888
  }
68840
68889
  }
68890
+ class WebWorkerTemplatePlugin {
68891
+ apply(compiler) {
68892
+ compiler.options.output.chunkLoading = "import-scripts";
68893
+ new ArrayPushCallbackChunkFormatPlugin().apply(compiler);
68894
+ new EnableChunkLoadingPlugin("import-scripts").apply(compiler);
68895
+ }
68896
+ }
68841
68897
  const options_process = (options, normalizeSimple, normalizeOptions, fn)=>{
68842
68898
  const array = (items)=>{
68843
68899
  for (const item of items)if ('string' == typeof item) fn(item, normalizeSimple(item, item));
@@ -69684,7 +69740,7 @@ class ModuleFederationPlugin {
69684
69740
  this._options = _options;
69685
69741
  }
69686
69742
  apply(compiler) {
69687
- const { webpack } = compiler;
69743
+ const { rspack } = compiler;
69688
69744
  const paths = getPaths(this._options, compiler);
69689
69745
  compiler.options.resolve.alias = {
69690
69746
  '@module-federation/runtime-tools': paths.runtimeTools,
@@ -69741,7 +69797,7 @@ class ModuleFederationPlugin {
69741
69797
  shared: this._options.shared,
69742
69798
  enhanced: true
69743
69799
  };
69744
- new webpack.container.ModuleFederationPluginV1(v1Options).apply(compiler);
69800
+ new rspack.container.ModuleFederationPluginV1(v1Options).apply(compiler);
69745
69801
  if (this._options.manifest) new ModuleFederationManifestPlugin(this._options).apply(compiler);
69746
69802
  }
69747
69803
  }
@@ -70016,7 +70072,7 @@ function transformSync(source, options) {
70016
70072
  const _options = JSON.stringify(options || {});
70017
70073
  return rspack_wasi_browser.transformSync(source, _options);
70018
70074
  }
70019
- const exports_rspackVersion = "2.0.0-rc.1";
70075
+ const exports_rspackVersion = "2.0.0-rc.3";
70020
70076
  const exports_version = "5.75.0";
70021
70077
  const exports_WebpackError = Error;
70022
70078
  const exports_config = {
@@ -70030,7 +70086,8 @@ const util = {
70030
70086
  cleverMerge: cachedCleverMerge
70031
70087
  };
70032
70088
  const web = {
70033
- FetchCompileAsyncWasmPlugin: FetchCompileAsyncWasmPlugin
70089
+ FetchCompileAsyncWasmPlugin: FetchCompileAsyncWasmPlugin,
70090
+ JsonpTemplatePlugin: JsonpTemplatePlugin
70034
70091
  };
70035
70092
  const exports_node = {
70036
70093
  NodeTargetPlugin: NodeTargetPlugin,
@@ -549,7 +549,6 @@ export declare enum BuiltinPluginName {
549
549
  HotModuleReplacementPlugin = 'HotModuleReplacementPlugin',
550
550
  LimitChunkCountPlugin = 'LimitChunkCountPlugin',
551
551
  WorkerPlugin = 'WorkerPlugin',
552
- WebWorkerTemplatePlugin = 'WebWorkerTemplatePlugin',
553
552
  MergeDuplicateChunksPlugin = 'MergeDuplicateChunksPlugin',
554
553
  SplitChunksPlugin = 'SplitChunksPlugin',
555
554
  RemoveDuplicateModulesPlugin = 'RemoveDuplicateModulesPlugin',
@@ -732,7 +731,7 @@ export interface JsBeforeModuleIdsArg {
732
731
  }
733
732
 
734
733
  export interface JsBeforeModuleIdsResult {
735
- assignments: Record<string, string>
734
+ assignments: Record<string, string | number>
736
735
  }
737
736
 
738
737
  export interface JsBuildMeta {
@@ -740,15 +739,11 @@ export interface JsBuildMeta {
740
739
  hasTopLevelAwait?: boolean
741
740
  esm?: boolean
742
741
  exportsType?: undefined | 'unset' | 'default' | 'namespace' | 'flagged' | 'dynamic'
743
- defaultObject?: undefined | 'false' | 'redirect' | JsBuildMetaDefaultObjectRedirectWarn
742
+ defaultObject?: undefined | 'false' | 'redirect' | 'redirect-warn'
744
743
  sideEffectFree?: boolean
745
744
  exportsFinalName?: Array<[string, string]> | undefined
746
745
  }
747
746
 
748
- export interface JsBuildMetaDefaultObjectRedirectWarn {
749
- redirectWarn: JsDefaultObjectRedirectWarnObject
750
- }
751
-
752
747
  export interface JsBuildTimeExecutionOption {
753
748
  publicPath?: string
754
749
  baseUri?: string
@@ -810,10 +805,6 @@ export interface JsCreateScriptData {
810
805
  chunk: Chunk
811
806
  }
812
807
 
813
- export interface JsDefaultObjectRedirectWarnObject {
814
- ignore: boolean
815
- }
816
-
817
808
  export interface JsDiagnostic {
818
809
  message: string
819
810
  help?: string
@@ -1893,6 +1884,7 @@ export interface RawCacheGroupOptions {
1893
1884
  minChunks?: number
1894
1885
  minSize?: number | RawSplitChunkSizes
1895
1886
  minSizeReduction?: number | RawSplitChunkSizes
1887
+ enforceSizeThreshold?: number | RawSplitChunkSizes
1896
1888
  maxSize?: number | RawSplitChunkSizes
1897
1889
  maxAsyncSize?: number | RawSplitChunkSizes
1898
1890
  maxInitialSize?: number | RawSplitChunkSizes
@@ -3008,7 +3000,7 @@ export interface RawSplitChunksOptions {
3008
3000
  hidePathInfo?: boolean
3009
3001
  minSize?: number | RawSplitChunkSizes
3010
3002
  minSizeReduction?: number | RawSplitChunkSizes
3011
- enforceSizeThreshold?: number
3003
+ enforceSizeThreshold?: number | RawSplitChunkSizes
3012
3004
  minRemainingSize?: number | RawSplitChunkSizes
3013
3005
  maxSize?: number | RawSplitChunkSizes
3014
3006
  maxAsyncSize?: number | RawSplitChunkSizes
@@ -17,13 +17,14 @@ const __wasi = new __WASI({
17
17
  },
18
18
  })
19
19
 
20
- const __wasmUrl = window.RSPACK_WASM_URL || new URL('./rspack.wasm32-wasi.wasm', import.meta.url).href
20
+ const __wasmUrl = globalThis.RSPACK_WASM_URL || new URL('./rspack.wasm32-wasi.wasm', import.meta.url).href
21
21
  const __emnapiContext = __emnapiGetDefaultContext()
22
22
  __emnapiContext.feature.Buffer = Buffer
23
23
 
24
+ // Allocate 2GB fixed shared memory (initial == maximum to disable memory.grow).
24
25
  const __sharedMemory = new WebAssembly.Memory({
25
- initial: 16384,
26
- maximum: 65536,
26
+ initial: 32768,
27
+ maximum: 32768,
27
28
  shared: true,
28
29
  })
29
30
 
@@ -57,6 +58,10 @@ const {
57
58
  ...importObject.napi,
58
59
  ...importObject.emnapi,
59
60
  memory: __sharedMemory,
61
+ // Override emnapi's napi_adjust_external_memory to a no-op.
62
+ // emnapi implements this by calling memory.grow, but we've disabled memory.grow
63
+ // (initial == maximum).
64
+ napi_adjust_external_memory() { return 0 },
60
65
  }
61
66
  return importObject
62
67
  },
Binary file
@@ -12358,7 +12358,7 @@
12358
12358
  const getgid = ()=>process_1.default.getgid?.() ?? 0;
12359
12359
  const EMPTY_BUFFER = (0, buffer_1.bufferAllocUnsafe)(0);
12360
12360
  let Node$1 = class {
12361
- constructor(ino, mode = 0o666){
12361
+ constructor(ino, mode = 0o666, uid = getuid(), gid = getgid()){
12362
12362
  this.changes = new fanout_1.FanOut();
12363
12363
  this._uid = getuid();
12364
12364
  this._gid = getgid();
@@ -12372,6 +12372,8 @@
12372
12372
  this._nlink = 1;
12373
12373
  this.mode = mode;
12374
12374
  this.ino = ino;
12375
+ this._uid = uid;
12376
+ this._gid = gid;
12375
12377
  }
12376
12378
  set ctime(ctime) {
12377
12379
  this._ctime = ctime;
@@ -15819,17 +15821,17 @@
15819
15821
  const pathJoin = path_1.posix ? path_1.posix.join : path_1.join;
15820
15822
  const { O_RDONLY, O_WRONLY, O_RDWR, O_CREAT, O_EXCL, O_TRUNC, O_APPEND, O_DIRECTORY } = fs_node_utils_1.constants;
15821
15823
  let Superblock$1 = class Superblock {
15822
- static fromJSON(json, cwd) {
15823
- const vol = new Superblock();
15824
+ static fromJSON(json, cwd, opts) {
15825
+ const vol = new Superblock(opts);
15824
15826
  vol.fromJSON(json, cwd);
15825
15827
  return vol;
15826
15828
  }
15827
- static fromNestedJSON(json, cwd) {
15828
- const vol = new Superblock();
15829
+ static fromNestedJSON(json, cwd, opts) {
15830
+ const vol = new Superblock(opts);
15829
15831
  vol.fromNestedJSON(json, cwd);
15830
15832
  return vol;
15831
15833
  }
15832
- constructor(props = {}){
15834
+ constructor(opts = {}){
15833
15835
  this.ino = 0;
15834
15836
  this.inodes = {};
15835
15837
  this.releasedInos = [];
@@ -16011,6 +16013,7 @@
16011
16013
  const file = this.getFileByFdOrThrow(fd, 'close');
16012
16014
  this.closeFile(file);
16013
16015
  };
16016
+ this.process = opts.process ?? process_1.default;
16014
16017
  const root = this.createLink();
16015
16018
  root.setNode(this.createNode(0o777 | fs_node_utils_1.constants.S_IFDIR));
16016
16019
  root.setChild('.', root);
@@ -16047,7 +16050,9 @@
16047
16050
  return 'number' == typeof releasedFd ? releasedFd : Superblock.fd--;
16048
16051
  }
16049
16052
  createNode(mode) {
16050
- const node = new Node_1.Node(this.newInoNumber(), mode);
16053
+ const uid = this.process.getuid?.() ?? 0;
16054
+ const gid = this.process.getgid?.() ?? 0;
16055
+ const node = new Node_1.Node(this.newInoNumber(), mode, uid, gid);
16051
16056
  this.inodes[node.ino] = node;
16052
16057
  return node;
16053
16058
  }
@@ -16071,10 +16076,12 @@
16071
16076
  }
16072
16077
  let curr = this.root;
16073
16078
  let i = 0;
16079
+ const uid = this.process.getuid?.() ?? 0;
16080
+ const gid = this.process.getgid?.() ?? 0;
16074
16081
  while(i < steps.length){
16075
16082
  let node = curr.getNode();
16076
16083
  if (node.isDirectory()) {
16077
- if (checkAccess && !node.canExecute()) return (0, result_1.Err)((0, util_1.createStatError)("EACCES", funcName, filename));
16084
+ if (checkAccess && !node.canExecute(uid, gid)) return (0, result_1.Err)((0, util_1.createStatError)("EACCES", funcName, filename));
16078
16085
  } else if (i < steps.length - 1) return (0, result_1.Err)((0, util_1.createStatError)("ENOTDIR", funcName, filename));
16079
16086
  curr = curr.getChild(steps[i]) ?? null;
16080
16087
  if (!curr) if (checkExistence) return (0, result_1.Err)((0, util_1.createStatError)("ENOENT", funcName, filename));
@@ -16088,7 +16095,7 @@
16088
16095
  continue;
16089
16096
  }
16090
16097
  if (checkExistence && !node.isDirectory() && i < steps.length - 1) {
16091
- const errorCode = 'win32' === process_1.default.platform ? "ENOENT" : "ENOTDIR";
16098
+ const errorCode = 'win32' === this.process.platform ? "ENOENT" : "ENOTDIR";
16092
16099
  return (0, result_1.Err)((0, util_1.createStatError)(errorCode, funcName, filename));
16093
16100
  }
16094
16101
  i++;
@@ -16192,7 +16199,7 @@
16192
16199
  for (const link of links)this._toJSON(link, json, isRelative ? link.getPath() : '', asBuffer);
16193
16200
  return json;
16194
16201
  }
16195
- fromJSON(json, cwd = process_1.default.cwd()) {
16202
+ fromJSON(json, cwd = this.process.cwd()) {
16196
16203
  for(let filename in json){
16197
16204
  const data = json[filename];
16198
16205
  filename = (0, util_1.resolve)(filename, cwd);
@@ -25933,8 +25940,9 @@
25933
25940
  });
25934
25941
  results.push(...dirResults.map((r)=>path_1.posix.resolve(dir, r)));
25935
25942
  } else {
25943
+ const normalizedPattern = pattern.replace(/^\.\//, '');
25936
25944
  const dirResults = walkDirectory(fs, resolvedCwd, [
25937
- pattern
25945
+ normalizedPattern
25938
25946
  ], globOptions);
25939
25947
  results.push(...dirResults);
25940
25948
  }
@@ -27107,8 +27115,8 @@
27107
27115
  }
27108
27116
  }
27109
27117
  volume.Volume = Volume;
27110
- Volume.fromJSON = (json, cwd)=>new Volume(fs_core_1.Superblock.fromJSON(json, cwd));
27111
- Volume.fromNestedJSON = (json, cwd)=>new Volume(fs_core_1.Superblock.fromNestedJSON(json, cwd));
27118
+ Volume.fromJSON = (json, cwd, opts)=>new Volume(fs_core_1.Superblock.fromJSON(json, cwd, opts));
27119
+ Volume.fromNestedJSON = (json, cwd, opts)=>new Volume(fs_core_1.Superblock.fromNestedJSON(json, cwd, opts));
27112
27120
  function emitStop(self1) {
27113
27121
  self1.emit('stop');
27114
27122
  }
@@ -27165,6 +27173,7 @@
27165
27173
  if (void 0 === options.highWaterMark) options.highWaterMark = 65536;
27166
27174
  stream_1.Readable.call(this, options);
27167
27175
  this.path = (0, util_3.pathToFilename)(path);
27176
+ this._fileHandle = options.fd && 'number' != typeof options.fd ? options.fd : null;
27168
27177
  this.fd = void 0 === options.fd ? null : 'number' != typeof options.fd ? options.fd.fd : options.fd;
27169
27178
  this.flags = void 0 === options.flags ? 'r' : options.flags;
27170
27179
  this.mode = void 0 === options.mode ? 0o666 : options.mode;
@@ -27244,7 +27253,8 @@
27244
27253
  }
27245
27254
  if ('boolean' == typeof this._readableState?.closed) this._readableState.closed = true;
27246
27255
  else this.closed = true;
27247
- this._vol.close(this.fd, (er)=>{
27256
+ if (this._fileHandle) this._fileHandle.close().then(()=>this.emit('close'), (er)=>this.emit('error', er));
27257
+ else this._vol.close(this.fd, (er)=>{
27248
27258
  if (er) this.emit('error', er);
27249
27259
  else this.emit('close');
27250
27260
  });
@@ -27261,6 +27271,7 @@
27261
27271
  options = Object.assign({}, (0, options_1.getOptions)(options, {}));
27262
27272
  stream_1.Writable.call(this, options);
27263
27273
  this.path = (0, util_3.pathToFilename)(path);
27274
+ this._fileHandle = options.fd && 'number' != typeof options.fd ? options.fd : null;
27264
27275
  this.fd = void 0 === options.fd ? null : 'number' != typeof options.fd ? options.fd.fd : options.fd;
27265
27276
  this.flags = void 0 === options.flags ? 'w' : options.flags;
27266
27277
  this.mode = void 0 === options.mode ? 0o666 : options.mode;
@@ -27340,7 +27351,8 @@
27340
27351
  }
27341
27352
  if ('boolean' == typeof this._writableState?.closed) this._writableState.closed = true;
27342
27353
  else this.closed = true;
27343
- this._vol.close(this.fd, (er)=>{
27354
+ if (this._fileHandle) this._fileHandle.close().then(()=>this.emit('close'), (er)=>this.emit('error', er));
27355
+ else this._vol.close(this.fd, (er)=>{
27344
27356
  if (er) this.emit('error', er);
27345
27357
  else this.emit('close');
27346
27358
  });
@@ -27748,8 +27760,14 @@
27748
27760
  return fs;
27749
27761
  }
27750
27762
  exports$1.fs = createFsFromVolume(exports$1.vol);
27751
- const memfs = (json = {}, cwd = '/')=>{
27752
- const vol = fs_node_1.Volume.fromNestedJSON(json, cwd);
27763
+ const memfs = (json = {}, cwdOrOpts = '/')=>{
27764
+ const opts = 'string' == typeof cwdOrOpts ? {
27765
+ cwd: cwdOrOpts
27766
+ } : cwdOrOpts;
27767
+ const cwd = opts.cwd ?? (opts.process ? void 0 : '/');
27768
+ const vol = fs_node_1.Volume.fromNestedJSON(json, cwd, {
27769
+ process: opts.process
27770
+ });
27753
27771
  const fs = createFsFromVolume(vol);
27754
27772
  return {
27755
27773
  fs,
@@ -27801,7 +27819,10 @@
27801
27819
  ...importObject.env,
27802
27820
  ...importObject.napi,
27803
27821
  ...importObject.emnapi,
27804
- memory: wasmMemory
27822
+ memory: wasmMemory,
27823
+ napi_adjust_external_memory () {
27824
+ return 0;
27825
+ }
27805
27826
  };
27806
27827
  }
27807
27828
  });
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The following code is modified based on
3
+ * https://github.com/webpack/webpack/blob/4b4ca3b/lib/web/JsonpTemplatePlugin.js
4
+ *
5
+ * MIT Licensed
6
+ * Author Tobias Koppers @sokra
7
+ * Copyright (c) JS Foundation and other contributors
8
+ * https://github.com/webpack/webpack/blob/main/LICENSE
9
+ */
10
+ import type { Compiler } from '../Compiler';
11
+ export default class JsonpTemplatePlugin {
12
+ apply(compiler: Compiler): void;
13
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The following code is modified based on
3
+ * https://github.com/webpack/webpack/blob/4b4ca3b/lib/webworker/WebWorkerTemplatePlugin.js
4
+ *
5
+ * MIT Licensed
6
+ * Author Tobias Koppers @sokra
7
+ * Copyright (c) JS Foundation and other contributors
8
+ * https://github.com/webpack/webpack/blob/main/LICENSE
9
+ */
10
+ import type { Compiler } from '../Compiler';
11
+ export default class WebWorkerTemplatePlugin {
12
+ apply(compiler: Compiler): void;
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/browser",
3
- "version": "2.0.0-rc.1",
3
+ "version": "2.0.0-rc.3",
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.",
@@ -29,7 +29,9 @@
29
29
  "directory": "packages/rspack-browser"
30
30
  },
31
31
  "dependencies": {
32
- "@napi-rs/wasm-runtime": "1.1.2",
32
+ "@emnapi/core": "1.9.2",
33
+ "@emnapi/runtime": "1.9.2",
34
+ "@napi-rs/wasm-runtime": "1.1.3",
33
35
  "@rspack/lite-tapable": "1.1.0",
34
36
  "@swc/types": "0.1.26",
35
37
  "@types/watchpack": "^2.4.5",
@@ -1,7 +0,0 @@
1
- import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
2
- import type { Compiler } from '../Compiler';
3
- import { RspackBuiltinPlugin } from './base';
4
- export declare class WebWorkerTemplatePlugin extends RspackBuiltinPlugin {
5
- name: BuiltinPluginName;
6
- raw(compiler: Compiler): BuiltinPlugin | undefined;
7
- }