@zohodesk/client_build_tool 0.0.14-exp.2 → 0.0.14-exp.4
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/lib/shared/bundler/webpack/custom_plugins/ChunkHierarchyPlugin.js +1 -1
- package/package.json +1 -1
- package/lib/shared/bundler/webpack/custom_plugins/BundleIntegrityReport/ChunkHierarchyPlugin.js +0 -52
- package/lib/shared/bundler/webpack/pluginConfigs/ChunkHierarchyPlugin.js +0 -15
- package/lib/shared/bundler/webpack/pluginConfigs/config +0 -0
|
@@ -38,7 +38,7 @@ class ChunkHierarchyPlugin {
|
|
|
38
38
|
for (const module of modules) {
|
|
39
39
|
for (const conn of moduleGraph.getOutgoingConnections(module)) {
|
|
40
40
|
if (conn.module && conn.module.resource) {
|
|
41
|
-
deps.add(conn.module.resource);
|
|
41
|
+
deps.add(conn.module.resource.match(/jsapps\/supportapp.*/)?.[1]);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
}
|
package/package.json
CHANGED
package/lib/shared/bundler/webpack/custom_plugins/BundleIntegrityReport/ChunkHierarchyPlugin.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// plugins/ChunkHierarchyPlugin.js
|
|
4
|
-
const fs = require("fs");
|
|
5
|
-
|
|
6
|
-
const path = require("path");
|
|
7
|
-
|
|
8
|
-
class ChunkHierarchyPlugin {
|
|
9
|
-
apply(compiler) {
|
|
10
|
-
compiler.hooks.afterEmit.tap("ChunkHierarchyPlugin", compilation => {
|
|
11
|
-
try {
|
|
12
|
-
const {
|
|
13
|
-
chunkGraph,
|
|
14
|
-
moduleGraph
|
|
15
|
-
} = compilation;
|
|
16
|
-
const hierarchy = {};
|
|
17
|
-
|
|
18
|
-
for (const chunk of compilation.chunks) {
|
|
19
|
-
// skip unnamed or runtime chunks
|
|
20
|
-
if (!chunk.name) continue;
|
|
21
|
-
if (chunk.name.includes("runtime")) continue;
|
|
22
|
-
const modules = chunkGraph.getChunkModulesIterable(chunk);
|
|
23
|
-
const deps = new Set();
|
|
24
|
-
|
|
25
|
-
for (const module of modules) {
|
|
26
|
-
for (const conn of moduleGraph.getOutgoingConnections(module)) {
|
|
27
|
-
if (conn.module && conn.module.resource) {
|
|
28
|
-
deps.add(conn.module.resource);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
hierarchy[chunk.name] = Array.from(deps);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const outputPath = compiler.options.output.path;
|
|
37
|
-
const outputFile = path.join(outputPath, "chunk-hierarchy-report.json"); // Ensure folder exists before writing
|
|
38
|
-
|
|
39
|
-
fs.mkdirSync(outputPath, {
|
|
40
|
-
recursive: true
|
|
41
|
-
});
|
|
42
|
-
fs.writeFileSync(outputFile, JSON.stringify(hierarchy, null, 2), "utf-8");
|
|
43
|
-
console.log(`🧩 Chunk hierarchy report written to: ${outputFile}`);
|
|
44
|
-
} catch (err) {
|
|
45
|
-
console.error("❌ ChunkHierarchyPlugin failed:", err);
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
module.exports = ChunkHierarchyPlugin;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ChunkHierarchyPlugin = ChunkHierarchyPlugin;
|
|
7
|
-
|
|
8
|
-
var _webpackBundleAnalyzer = require("webpack-bundle-analyzer");
|
|
9
|
-
|
|
10
|
-
var _modeUtils = require("../common/modeUtils");
|
|
11
|
-
|
|
12
|
-
/* eslint-disable no-use-before-define */
|
|
13
|
-
function ChunkHierarchyPlugin(options) {
|
|
14
|
-
return new _webpackBundleAnalyzer.BundleAnalyzerPlugin(bundleAnalyzerOptions);
|
|
15
|
-
}
|
|
File without changes
|