xhs-mp-pack 2.1.5 → 2.1.6-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.
@@ -813,7 +813,22 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
813
813
  if (cachedModule !== unsafeCachedModule) {
814
814
  unsafeCacheDependencies.set(dep, cachedModule);
815
815
  }
816
- cachedModule.restoreFromUnsafeCache(data, this.params.normalModuleFactory, this.params);
816
+ try {
817
+ // console.warn(`[DEBUG] Restoring module ${identifier} from unsafe cache`)
818
+ cachedModule.restoreFromUnsafeCache(data, this.params.normalModuleFactory, this.params);
819
+ // console.warn(`[DEBUG] Restored module ${identifier} from unsafe cache`)
820
+ }
821
+ catch (error) {
822
+ // console.warn('[DEBUG] Restoring module from unsafe cache failed, falling back to normal resolution:', identifier)
823
+ // 清除该模块的所有缓存引用,防止其他依赖使用损坏的缓存
824
+ unsafeCacheDependencies.delete(dep);
825
+ unsafeCacheData.delete(cachedModule);
826
+ this._restoredUnsafeCacheEntries.delete(identifier);
827
+ processDependencyForResolving(dep);
828
+ if (--inProgressSorting === 0)
829
+ onDependenciesSorted();
830
+ return;
831
+ }
817
832
  this._restoredUnsafeCacheEntries.set(identifier, cachedModule);
818
833
  this._restoredUnsafeCacheModuleEntries.add(cachedModule);
819
834
  if (!this.modules.has(cachedModule)) {
@@ -832,6 +847,9 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
832
847
  onDependenciesSorted();
833
848
  return;
834
849
  }
850
+ else {
851
+ // console.log(`[DEBUG] Module ${identifier} IS in this.modules, using existing`)
852
+ }
835
853
  }
836
854
  if (unsafeCachedModule !== cachedModule) {
837
855
  unsafeCacheDependencies.set(dep, cachedModule);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xhs-mp-pack",
3
- "version": "2.1.5",
3
+ "version": "2.1.6-beta.0",
4
4
  "description": "xhs mp compiler core.",
5
5
  "preferGlobal": true,
6
6
  "category": "esm",
@@ -55,9 +55,9 @@
55
55
  "watchpack": "^2.4.0",
56
56
  "webpack-chain": "^6.5.1",
57
57
  "webpack-sources": "^3.2.3",
58
- "xhs-mp-compiler-utils": "2.1.5",
59
- "xhs-mp-project": "2.1.5",
60
- "xhs-mp-shared-fs": "2.1.5"
58
+ "xhs-mp-compiler-utils": "2.1.6-beta.0",
59
+ "xhs-mp-project": "2.1.6-beta.0",
60
+ "xhs-mp-shared-fs": "2.1.6-beta.0"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@types/babel__generator": "7.6.3",