@umijs/mfsu 4.0.22 → 4.0.24

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.
package/dist/depInfo.js CHANGED
@@ -49,9 +49,15 @@ var DepInfo = class {
49
49
  loadCache() {
50
50
  if ((0, import_fs.existsSync)(this.cacheFilePath)) {
51
51
  import_utils.logger.info("[MFSU] restore cache");
52
- const { cacheDependency, moduleGraph } = JSON.parse((0, import_fs.readFileSync)(this.cacheFilePath, "utf-8"));
53
- this.cacheDependency = cacheDependency;
54
- this.moduleGraph.restore(moduleGraph);
52
+ try {
53
+ const { cacheDependency, moduleGraph } = JSON.parse((0, import_fs.readFileSync)(this.cacheFilePath, "utf-8"));
54
+ this.cacheDependency = cacheDependency;
55
+ this.moduleGraph.restore(moduleGraph);
56
+ } catch (e) {
57
+ import_utils.logger.error("[MFSU] restore cache failed", e);
58
+ import_utils.logger.error("please `rm -rf node_modules/.cache`, and try again");
59
+ throw e;
60
+ }
55
61
  }
56
62
  }
57
63
  writeCache() {
@@ -99,8 +99,12 @@ var StaticDepInfo = class {
99
99
  }
100
100
  loadCache() {
101
101
  if ((0, import_fs.existsSync)(this.cacheFilePath)) {
102
- this.builtWithDep = JSON.parse((0, import_fs.readFileSync)(this.cacheFilePath, "utf-8"));
103
- import_utils.logger.info("[MFSU][eager] restored cache");
102
+ try {
103
+ this.builtWithDep = JSON.parse((0, import_fs.readFileSync)(this.cacheFilePath, "utf-8"));
104
+ import_utils.logger.info("[MFSU][eager] restored cache");
105
+ } catch (e) {
106
+ import_utils.logger.warn("[MFSU][eager] restore cache failed, fallback to Empty dependency", e);
107
+ }
104
108
  }
105
109
  }
106
110
  writeCache() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/mfsu",
3
- "version": "4.0.22",
3
+ "version": "4.0.24",
4
4
  "description": "@umijs/mfsu",
5
5
  "homepage": "https://github.com/umijs/umi/tree/master/packages/mfsu#readme",
6
6
  "bugs": "https://github.com/umijs/umi/issues",
@@ -23,9 +23,9 @@
23
23
  "test": "umi-scripts jest-turbo"
24
24
  },
25
25
  "dependencies": {
26
- "@umijs/bundler-esbuild": "4.0.22",
27
- "@umijs/bundler-utils": "4.0.22",
28
- "@umijs/utils": "4.0.22",
26
+ "@umijs/bundler-esbuild": "4.0.24",
27
+ "@umijs/bundler-utils": "4.0.24",
28
+ "@umijs/utils": "4.0.24",
29
29
  "enhanced-resolve": "5.9.3",
30
30
  "is-equal": "^1.6.4"
31
31
  },