@rspack/core 0.5.7 → 0.5.8

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.
@@ -480,7 +480,7 @@ function getRawAssetGeneratorOptions(options) {
480
480
  function getRawAssetInlineGeneratorOptions(options) {
481
481
  return {
482
482
  dataUrl: options.dataUrl
483
- ? getRawAssetGeneratorDaraUrl(options.dataUrl)
483
+ ? getRawAssetGeneratorDataUrl(options.dataUrl)
484
484
  : undefined
485
485
  };
486
486
  }
@@ -490,17 +490,18 @@ function getRawAssetResourceGeneratorOptions(options) {
490
490
  publicPath: options.publicPath
491
491
  };
492
492
  }
493
- function getRawAssetGeneratorDaraUrl(dataUrl) {
493
+ function getRawAssetGeneratorDataUrl(dataUrl) {
494
494
  if (typeof dataUrl === "object" && dataUrl !== null) {
495
+ const encoding = dataUrl.encoding === false ? "false" : dataUrl.encoding;
495
496
  return {
496
- type: "options",
497
- options: {
498
- encoding: dataUrl.encoding === false ? "false" : dataUrl.encoding,
499
- mimetype: dataUrl.mimetype
500
- }
497
+ encoding,
498
+ mimetype: dataUrl.mimetype
501
499
  };
502
500
  }
503
- throw new Error(`unreachable: AssetGeneratorDataUrl type should be one of "options", but got ${dataUrl}`);
501
+ if (typeof dataUrl === "function" && dataUrl !== null) {
502
+ return dataUrl;
503
+ }
504
+ throw new Error(`unreachable: AssetGeneratorDataUrl type should be one of "options", "function", but got ${dataUrl}`);
504
505
  }
505
506
  function getRawOptimization(optimization) {
506
507
  (0, assert_1.default)(!(0, util_1.isNil)(optimization.removeAvailableModules) &&