@rsdoctor/core 0.4.10 → 0.4.12

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.
@@ -5,6 +5,7 @@ type IGenerateReportOpts = {
5
5
  reportTitle?: string;
6
6
  bundleDir?: string;
7
7
  openBrowser?: boolean;
8
+ reportDir?: string;
8
9
  };
9
10
  export declare function generateTileGraph(bundleStats: Plugin.BaseStats, opts: IGenerateReportOpts, buildOutputPath: string): Promise<string | null>;
10
11
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"generateTileGraph.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/build/chunks/generateTileGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAKzC,eAAO,MAAM,mBAAmB,6BAA6B,CAAC;AAE9D,KAAK,mBAAmB,GAAG;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAiBF,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,MAAM,CAAC,SAAS,EAC7B,IAAI,EAAE,mBAAmB,EACzB,eAAe,EAAE,MAAM,0BAexB"}
1
+ {"version":3,"file":"generateTileGraph.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/build/chunks/generateTileGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAKzC,eAAO,MAAM,mBAAmB,6BAA6B,CAAC;AAE9D,KAAK,mBAAmB,GAAG;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAiBF,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,MAAM,CAAC,SAAS,EAC7B,IAAI,EAAE,mBAAmB,EACzB,eAAe,EAAE,MAAM,0BAuBxB"}
@@ -52,13 +52,19 @@ async function generateJSONReportUtil(bundleStats, opts) {
52
52
  }
53
53
  async function generateTileGraph(bundleStats, opts, buildOutputPath) {
54
54
  try {
55
- const { reportFilename } = opts;
55
+ const { reportFilename, reportDir } = opts;
56
56
  await generateJSONReportUtil(bundleStats, {
57
57
  ...opts,
58
58
  openBrowser: false,
59
- bundleDir: buildOutputPath
59
+ bundleDir: reportDir || buildOutputPath
60
60
  });
61
- return import_path.default.join(buildOutputPath, `${reportFilename}`);
61
+ return import_path.default.join(
62
+ reportDir ? import_path.default.resolve(
63
+ buildOutputPath,
64
+ import_path.default.relative(buildOutputPath, reportDir)
65
+ ) : buildOutputPath,
66
+ `${reportFilename}`
67
+ );
62
68
  } catch (e) {
63
69
  (0, import_logger.debug)(() => `Generate webpack-bundle-analyzer tile graph has error:${e}`);
64
70
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"ensureModulesChunkGraph.d.ts","sourceRoot":"","sources":["../../../src/inner-plugins/plugins/ensureModulesChunkGraph.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAuB,MAAM,iBAAiB,CAAC;AAWtE;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,aAC3B,MAAM,CAAC,YAAY,SACtB,sBAAsB,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,cAAc,EAAE,CAAC,SAwF5E,CAAC"}
1
+ {"version":3,"file":"ensureModulesChunkGraph.d.ts","sourceRoot":"","sources":["../../../src/inner-plugins/plugins/ensureModulesChunkGraph.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAuB,MAAM,iBAAiB,CAAC;AAWtE;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,aAC3B,MAAM,CAAC,YAAY,SACtB,sBAAsB,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,cAAc,EAAE,CAAC,SAiG5E,CAAC"}
@@ -67,6 +67,14 @@ const ensureModulesChunksGraphFn = (compiler, _this) => {
67
67
  );
68
68
  (0, import_logger.debug)(import_build.Process.getMemoryUsageMessage, "[After Generate ModuleGraph]");
69
69
  if (_this.options.features.treeShaking) {
70
+ if ("rspackVersion" in compiler.webpack) {
71
+ import_logger.logger.info(
72
+ import_logger.chalk.yellow(
73
+ "Rspack currently does not support treeShaking capabilities."
74
+ )
75
+ );
76
+ return;
77
+ }
70
78
  _this.modulesGraph = import_build2.ModuleGraph.appendTreeShaking(
71
79
  _this.modulesGraph,
72
80
  stats.compilation
@@ -97,7 +105,8 @@ const ensureModulesChunksGraphFn = (compiler, _this) => {
97
105
  import_types2.Constants.RsdoctorOutputFolder,
98
106
  import_build2.Chunks.TileGraphReportName
99
107
  ),
100
- reportTitle: "bundle-analyzer"
108
+ reportTitle: "bundle-analyzer",
109
+ reportDir: _this.options.reportDir
101
110
  },
102
111
  compiler.outputPath
103
112
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsdoctor/core",
3
- "version": "0.4.10",
3
+ "version": "0.4.12",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/web-infra-dev/rsdoctor",
@@ -62,7 +62,7 @@
62
62
  }
63
63
  },
64
64
  "dependencies": {
65
- "axios": "^1.7.8",
65
+ "axios": "^1.7.9",
66
66
  "enhanced-resolve": "5.12.0",
67
67
  "filesize": "^10.1.6",
68
68
  "fs-extra": "^11.1.1",
@@ -71,13 +71,13 @@
71
71
  "semver": "^7.6.3",
72
72
  "source-map": "^0.7.4",
73
73
  "webpack-bundle-analyzer": "^4.10.2",
74
- "@rsdoctor/graph": "0.4.10",
75
- "@rsdoctor/sdk": "0.4.10",
76
- "@rsdoctor/types": "0.4.10",
77
- "@rsdoctor/utils": "0.4.10"
74
+ "@rsdoctor/graph": "0.4.12",
75
+ "@rsdoctor/sdk": "0.4.12",
76
+ "@rsdoctor/types": "0.4.12",
77
+ "@rsdoctor/utils": "0.4.12"
78
78
  },
79
79
  "devDependencies": {
80
- "@rspack/core": "^1.1.4",
80
+ "@rspack/core": "^1.1.6",
81
81
  "@types/fs-extra": "^11.0.4",
82
82
  "@types/lodash": "^4.17.13",
83
83
  "@types/node": "^16",
@@ -88,7 +88,7 @@
88
88
  "babel-loader": "9.1.3",
89
89
  "string-loader": "0.0.1",
90
90
  "ts-loader": "^9.5.1",
91
- "tslib": "2.7.0",
91
+ "tslib": "2.8.1",
92
92
  "typescript": "^5.2.2",
93
93
  "webpack": "^5.95.0",
94
94
  "@scripts/test-helper": "0.1.1"