@rspack/core 0.6.0-canary-f5973db-20240409131230 → 0.6.0-canary-77faf73-20240410004447

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.
@@ -136,12 +136,8 @@ export declare class Compilation {
136
136
  * Source: [updateAsset](https://github.com/webpack/webpack/blob/9fcaa243573005d6fdece9a3f8d89a0e8b399613/lib/Compilation.js#L4320)
137
137
  *
138
138
  * FIXME: *AssetInfo* may be undefined in update fn for webpack impl, but still not implemented in rspack
139
- *
140
- * @param {string} file file name
141
- * @param {Source | function(Source): Source} newSourceOrFunction new asset source or function converting old to new
142
- * @param {AssetInfo | function(AssetInfo): AssetInfo} assetInfoUpdateOrFunction new asset info or function converting old to new
143
139
  */
144
- updateAsset(filename: string, newSourceOrFunction: Source | ((source: Source) => Source), assetInfoUpdateOrFunction: AssetInfo | ((assetInfo: AssetInfo) => AssetInfo)): void;
140
+ updateAsset(filename: string, newSourceOrFunction: Source | ((source: Source) => Source), assetInfoUpdateOrFunction?: AssetInfo | ((assetInfo: AssetInfo) => AssetInfo)): void;
145
141
  /**
146
142
  * Emit an not existing asset. Trying to emit an asset that already exists will throw an error.
147
143
  *
@@ -295,10 +295,6 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
295
295
  * Source: [updateAsset](https://github.com/webpack/webpack/blob/9fcaa243573005d6fdece9a3f8d89a0e8b399613/lib/Compilation.js#L4320)
296
296
  *
297
297
  * FIXME: *AssetInfo* may be undefined in update fn for webpack impl, but still not implemented in rspack
298
- *
299
- * @param {string} file file name
300
- * @param {Source | function(Source): Source} newSourceOrFunction new asset source or function converting old to new
301
- * @param {AssetInfo | function(AssetInfo): AssetInfo} assetInfoUpdateOrFunction new asset info or function converting old to new
302
298
  */
303
299
  updateAsset(filename, newSourceOrFunction, assetInfoUpdateOrFunction) {
304
300
  let compatNewSourceOrFunction;
@@ -310,9 +306,11 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
310
306
  else {
311
307
  compatNewSourceOrFunction = (0, createSource_1.createRawFromSource)(newSourceOrFunction);
312
308
  }
313
- __classPrivateFieldGet(this, _Compilation_inner, "f").updateAsset(filename, compatNewSourceOrFunction, typeof assetInfoUpdateOrFunction === "function"
314
- ? jsAssetInfo => (0, util_1.toJsAssetInfo)(assetInfoUpdateOrFunction(jsAssetInfo))
315
- : (0, util_1.toJsAssetInfo)(assetInfoUpdateOrFunction));
309
+ __classPrivateFieldGet(this, _Compilation_inner, "f").updateAsset(filename, compatNewSourceOrFunction, assetInfoUpdateOrFunction === undefined
310
+ ? assetInfoUpdateOrFunction
311
+ : typeof assetInfoUpdateOrFunction === "function"
312
+ ? jsAssetInfo => (0, util_1.toJsAssetInfo)(assetInfoUpdateOrFunction(jsAssetInfo))
313
+ : (0, util_1.toJsAssetInfo)(assetInfoUpdateOrFunction));
316
314
  }
317
315
  /**
318
316
  * Emit an not existing asset. Trying to emit an asset that already exists will throw an error.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/core",
3
- "version": "0.6.0-canary-f5973db-20240409131230",
3
+ "version": "0.6.0-canary-77faf73-20240410004447",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "A Fast Rust-based Web Bundler",
@@ -59,8 +59,8 @@
59
59
  "styled-components": "^6.0.8",
60
60
  "terser": "5.27.2",
61
61
  "wast-loader": "^1.11.4",
62
- "@rspack/core": "0.6.0-canary-f5973db-20240409131230",
63
- "@rspack/plugin-minify": "^0.6.0-canary-f5973db-20240409131230"
62
+ "@rspack/core": "0.6.0-canary-77faf73-20240410004447",
63
+ "@rspack/plugin-minify": "^0.6.0-canary-77faf73-20240410004447"
64
64
  },
65
65
  "dependencies": {
66
66
  "@module-federation/runtime-tools": "0.0.8",
@@ -75,7 +75,7 @@
75
75
  "webpack-sources": "3.2.3",
76
76
  "zod": "^3.21.4",
77
77
  "zod-validation-error": "1.3.1",
78
- "@rspack/binding": "0.6.0-canary-f5973db-20240409131230"
78
+ "@rspack/binding": "0.6.0-canary-77faf73-20240410004447"
79
79
  },
80
80
  "peerDependencies": {
81
81
  "@swc/helpers": ">=0.5.1"