@rspack-canary/browser 1.6.1-canary-61cb132a-20251105091940 → 1.6.1-canary-72453ec6-20251216043959

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.
@@ -33,6 +33,7 @@ type Headers = {
33
33
  value: string;
34
34
  }[] | Record<string, string | string[]>;
35
35
  type OutputFileSystem = import("..").OutputFileSystem & {
36
+ createReadStream?: typeof import("fs").createReadStream;
36
37
  statSync: import("fs").StatSyncFn;
37
38
  readFileSync: typeof import("fs").readFileSync;
38
39
  };
package/dist/index.mjs CHANGED
@@ -53396,16 +53396,16 @@ function applyLimits(options, logger) {
53396
53396
  }
53397
53397
  if (void 0 === options.output.chunkLoading) options.output.chunkLoading = "import";
53398
53398
  if (options.output.library) options.output.library = void 0;
53399
- let { splitChunks } = options.optimization;
53400
- if (void 0 === splitChunks) splitChunks = options.optimization.splitChunks = {};
53401
- if (false !== splitChunks) {
53399
+ const { splitChunks } = options.optimization;
53400
+ if (splitChunks) {
53402
53401
  splitChunks.chunks = "all";
53403
53402
  splitChunks.minSize = 0;
53404
53403
  splitChunks.maxAsyncRequests = 1 / 0;
53405
53404
  splitChunks.maxInitialRequests = 1 / 0;
53406
- splitChunks.cacheGroups ??= {};
53407
- splitChunks.cacheGroups.default = false;
53408
- splitChunks.cacheGroups.defaultVendors = false;
53405
+ if (splitChunks.cacheGroups) {
53406
+ splitChunks.cacheGroups.default = false;
53407
+ splitChunks.cacheGroups.defaultVendors = false;
53408
+ }
53409
53409
  }
53410
53410
  }
53411
53411
  class EsmLibraryPlugin {
@@ -58126,7 +58126,7 @@ const applybundlerInfoDefaults = (rspackFuture, library)=>{
58126
58126
  if ("object" == typeof rspackFuture) {
58127
58127
  D(rspackFuture, "bundlerInfo", {});
58128
58128
  if ("object" == typeof rspackFuture.bundlerInfo) {
58129
- D(rspackFuture.bundlerInfo, "version", "1.6.1-canary-61cb132a-20251105091940");
58129
+ D(rspackFuture.bundlerInfo, "version", "1.6.1-canary-72453ec6-20251216043959");
58130
58130
  D(rspackFuture.bundlerInfo, "bundler", "rspack");
58131
58131
  D(rspackFuture.bundlerInfo, "force", !library);
58132
58132
  }
@@ -59670,7 +59670,7 @@ class MergedEtag {
59670
59670
  }
59671
59671
  const dualObjectMap = new WeakMap();
59672
59672
  const objectStringMap = new WeakMap();
59673
- const mergeEtags = (first, second)=>{
59673
+ const mergeEtags_mergeEtags = (first, second)=>{
59674
59674
  let a = first;
59675
59675
  let b = second;
59676
59676
  if ("string" == typeof a) {
@@ -59761,9 +59761,9 @@ class ItemCacheFacade {
59761
59761
  this._etag = etag;
59762
59762
  }
59763
59763
  }
59764
- class CacheFacade {
59764
+ class CacheFacade_CacheFacade {
59765
59765
  getChildCache(name) {
59766
- return new CacheFacade(this._cache, `${this._name}|${name}`, this._hashFunction);
59766
+ return new CacheFacade_CacheFacade(this._cache, `${this._name}|${name}`, this._hashFunction);
59767
59767
  }
59768
59768
  getItemCache(identifier, etag) {
59769
59769
  return new ItemCacheFacade(this._cache, `${this._name}|${identifier}`, etag);
@@ -59772,7 +59772,7 @@ class CacheFacade {
59772
59772
  return getLazyHashedEtag_getter(obj, this._hashFunction);
59773
59773
  }
59774
59774
  mergeEtags(a, b) {
59775
- return mergeEtags(a, b);
59775
+ return mergeEtags_mergeEtags(a, b);
59776
59776
  }
59777
59777
  get(identifier, etag, callback) {
59778
59778
  this._cache.get(`${this._name}|${identifier}`, etag, callback);
@@ -59825,7 +59825,7 @@ class CacheFacade {
59825
59825
  this._hashFunction = hashFunction;
59826
59826
  }
59827
59827
  }
59828
- const lib_CacheFacade = CacheFacade;
59828
+ const CacheFacade = CacheFacade_CacheFacade;
59829
59829
  function NormalModuleFactory_define_property(obj, key, value) {
59830
59830
  if (key in obj) Object.defineProperty(obj, key, {
59831
59831
  value: value,
@@ -60528,9 +60528,7 @@ const createCompilerHooksRegisters = (getCompiler, createTap)=>({
60528
60528
  targetPath,
60529
60529
  outputPath,
60530
60530
  get source () {
60531
- const source = getCompiler().__internal__get_compilation().getAsset(filename)?.source;
60532
- if (!source) throw new Error(`Asset ${filename} not found`);
60533
- return source;
60531
+ return getCompiler().__internal__get_compilation().getAsset(filename)?.source;
60534
60532
  },
60535
60533
  get content () {
60536
60534
  return this.source?.buffer();
@@ -61433,7 +61431,7 @@ class Compiler {
61433
61431
  return Compiler_class_private_field_get(this, _ruleSet);
61434
61432
  }
61435
61433
  getCache(name) {
61436
- return new lib_CacheFacade(this.cache, `${this.compilerPath}${name}`, this.options.output.hashFunction);
61434
+ return new CacheFacade(this.cache, `${this.compilerPath}${name}`, this.options.output.hashFunction);
61437
61435
  }
61438
61436
  getInfrastructureLogger(name) {
61439
61437
  if (!name) throw new TypeError("Compiler.getInfrastructureLogger(name) called without a name");
@@ -61845,8 +61843,8 @@ class Compiler {
61845
61843
  ]),
61846
61844
  additionalPass: new AsyncSeriesHook([])
61847
61845
  };
61848
- this.webpack = src_rspack_0;
61849
- this.rspack = src_rspack_0;
61846
+ this.webpack = src_rspack;
61847
+ this.rspack = src_rspack;
61850
61848
  this.root = this;
61851
61849
  this.outputPath = "";
61852
61850
  this.inputFileSystem = null;
@@ -62068,7 +62066,7 @@ class MultiStats {
62068
62066
  return obj;
62069
62067
  });
62070
62068
  if (childOptions.version) {
62071
- obj.rspackVersion = "1.6.1-canary-61cb132a-20251105091940";
62069
+ obj.rspackVersion = "1.6.1-canary-72453ec6-20251216043959";
62072
62070
  obj.version = "5.75.0";
62073
62071
  }
62074
62072
  if (childOptions.hash) obj.hash = obj.children.map((j)=>j.hash).join("");
@@ -62235,7 +62233,7 @@ function ArrayQueue_define_property(obj, key, value) {
62235
62233
  var ArrayQueue_computedKey;
62236
62234
  ArrayQueue_computedKey = Symbol.iterator;
62237
62235
  let ArrayQueue_computedKey1 = ArrayQueue_computedKey;
62238
- class ArrayQueue {
62236
+ class ArrayQueue_ArrayQueue {
62239
62237
  get length() {
62240
62238
  return this._list.length + this._listReversed.length;
62241
62239
  }
@@ -62277,7 +62275,7 @@ class ArrayQueue {
62277
62275
  this._listReversed = [];
62278
62276
  }
62279
62277
  }
62280
- const util_ArrayQueue = ArrayQueue;
62278
+ const ArrayQueue = ArrayQueue_ArrayQueue;
62281
62279
  var MultiCompiler_process = __webpack_require__("../../node_modules/.pnpm/process@0.11.10/node_modules/process/browser.js");
62282
62280
  function MultiCompiler_check_private_redeclaration(obj, privateCollection) {
62283
62281
  if (privateCollection.has(obj)) throw new TypeError("Cannot initialize the same private elements twice on an object");
@@ -62496,7 +62494,7 @@ function runGraph(setup, run, callback) {
62496
62494
  parent.children.push(node);
62497
62495
  }
62498
62496
  }
62499
- const queue = new util_ArrayQueue();
62497
+ const queue = new ArrayQueue();
62500
62498
  for (const node of nodes)if (0 === node.parents.length) {
62501
62499
  node.state = "queued";
62502
62500
  queue.enqueue(node);
@@ -63373,7 +63371,7 @@ const SIMPLE_EXTRACTORS = {
63373
63371
  },
63374
63372
  version: (object)=>{
63375
63373
  object.version = "5.75.0";
63376
- object.rspackVersion = "1.6.1-canary-61cb132a-20251105091940";
63374
+ object.rspackVersion = "1.6.1-canary-72453ec6-20251216043959";
63377
63375
  },
63378
63376
  env: (object, _compilation, _context, { _env })=>{
63379
63377
  object.env = _env;
@@ -66339,7 +66337,7 @@ function transformSync(source, options) {
66339
66337
  const _options = JSON.stringify(options || {});
66340
66338
  return external_rspack_wasi_browser_js_["default"].transformSync(source, _options);
66341
66339
  }
66342
- const exports_rspackVersion = "1.6.1-canary-61cb132a-20251105091940";
66340
+ const exports_rspackVersion = "1.6.1-canary-72453ec6-20251216043959";
66343
66341
  const exports_version = "5.75.0";
66344
66342
  const exports_WebpackError = Error;
66345
66343
  const sources = __webpack_require__("../../node_modules/.pnpm/webpack-sources@3.3.3_patch_hash=b2a26650f08a2359d0a3cd81fa6fa272aa7441a28dd7e601792da5ed5d2b4aee/node_modules/webpack-sources/lib/index.js");
@@ -66433,9 +66431,6 @@ const ERROR_PREFIX = "Invalid Rspack configuration:";
66433
66431
  const validateContext = ({ context })=>{
66434
66432
  if (context && !(0, path_browserify.isAbsolute)(context)) throw new Error(`${ERROR_PREFIX} "context" must be an absolute path, get "${context}".`);
66435
66433
  };
66436
- const validateOutputPath = ({ output })=>{
66437
- if (output?.path && !(0, path_browserify.isAbsolute)(output.path)) throw new Error(`${ERROR_PREFIX} "output.path" must be an absolute path, get "${output.path}".`);
66438
- };
66439
66434
  const validateSplitChunks = ({ optimization })=>{
66440
66435
  if (optimization?.splitChunks) {
66441
66436
  const { minChunks } = optimization.splitChunks;
@@ -66465,7 +66460,6 @@ const validateExternalUmd = ({ output, externals, externalsType })=>{
66465
66460
  };
66466
66461
  function validateRspackConfig(config) {
66467
66462
  validateContext(config);
66468
- validateOutputPath(config);
66469
66463
  validateSplitChunks(config);
66470
66464
  validateExternalUmd(config);
66471
66465
  }
@@ -66498,7 +66492,7 @@ function createCompiler(userOptions) {
66498
66492
  function isMultiRspackOptions(o) {
66499
66493
  return Array.isArray(o);
66500
66494
  }
66501
- function rspack(options, callback) {
66495
+ function rspack_rspack(options, callback) {
66502
66496
  try {
66503
66497
  if (isMultiRspackOptions(options)) for (const option of options)validateRspackConfig(option);
66504
66498
  else validateRspackConfig(options);
@@ -66548,11 +66542,11 @@ function rspack(options, callback) {
66548
66542
  return compiler;
66549
66543
  }
66550
66544
  }
66551
- const src_fn = Object.assign(rspack, exports_namespaceObject);
66545
+ const src_fn = Object.assign(rspack_rspack, exports_namespaceObject);
66552
66546
  src_fn.rspack = src_fn;
66553
66547
  src_fn.webpack = src_fn;
66554
- const src_rspack_0 = src_fn;
66555
- const src_0 = src_rspack_0;
66548
+ const src_rspack = src_fn;
66549
+ const src_0 = src_rspack;
66556
66550
  function BrowserHttpImportEsmPlugin_define_property(obj, key, value) {
66557
66551
  if (key in obj) Object.defineProperty(obj, key, {
66558
66552
  value: value,
@@ -66750,4 +66744,4 @@ var __webpack_exports__EntryDependency = external_rspack_wasi_browser_js_.EntryD
66750
66744
  var __webpack_exports__ExternalModule = external_rspack_wasi_browser_js_.ExternalModule;
66751
66745
  var __webpack_exports__Module = external_rspack_wasi_browser_js_.Module;
66752
66746
  var __webpack_exports__NormalModule = external_rspack_wasi_browser_js_.NormalModule;
66753
- 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, 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_0 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 };
66747
+ 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, 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 };
@@ -707,11 +707,11 @@ export interface JsBeforeEmitData {
707
707
  }
708
708
 
709
709
  export interface JsBuildMeta {
710
- strictEsmModule?: boolean
711
- hasTopLevelAwait?: boolean
712
- esm?: boolean
713
- exportsType?: undefined | 'unset' | 'default' | 'namespace' | 'flagged' | 'dynamic'
714
- defaultObject?: undefined | 'false' | 'redirect' | JsBuildMetaDefaultObjectRedirectWarn
710
+ strictEsmModule: boolean
711
+ hasTopLevelAwait: boolean
712
+ esm: boolean
713
+ exportsType: 'unset' | 'default' | 'namespace' | 'flagged' | 'dynamic'
714
+ defaultObject: 'false' | 'redirect' | JsBuildMetaDefaultObjectRedirectWarn
715
715
  sideEffectFree?: boolean
716
716
  exportsFinalName?: Array<[string, string]> | undefined
717
717
  }
@@ -2732,6 +2732,12 @@ export interface RawRslibPluginOptions {
2732
2732
  * @default `false`
2733
2733
  */
2734
2734
  interceptApiPlugin?: boolean
2735
+ /**
2736
+ * Use the compact runtime for dynamic import from `modern-module`, commonly used in CommonJS output.
2737
+ * This field should not be set to `true` when using `modern-module` with ESM output, as it is already in use.
2738
+ * @default `false`
2739
+ */
2740
+ compactExternalModuleDynamicImport?: boolean
2735
2741
  /**
2736
2742
  * Add shims for javascript/esm modules
2737
2743
  * @default `false`
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack-canary/browser",
3
- "version": "1.6.1-canary-61cb132a-20251105091940",
3
+ "version": "1.6.1-canary-72453ec6-20251216043959",
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.",