@nx/angular-rspack 22.7.0-beta.2 → 22.7.0-beta.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/stats.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,sBAAsB,EAGvB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,KAAK,EACL,YAAY,EACb,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,oCAAoC,EACpC,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,yCAAyC,CAAC;AAMjD,MAAM,WAAW,qBAAqB;IACpC,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI,CAAC;CAC7C;AAED,MAAM,MAAM,kBAAkB,GAAG,OAAO,CACtC,aAAa,CAAC,OAAO,CAAC,EACtB,MAAM,GAAG,OAAO,GAAG,SAAS,CAC7B,CAAC;AAEF,wBAAgB,yBAAyB,CACvC,gBAAgB,EAAE,kBAAkB,EAAE,EACtC,iBAAiB,EAAE,MAAM,GACxB,oBAAoB,EAAE,CAmBxB;
|
|
1
|
+
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/stats.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,sBAAsB,EAGvB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,KAAK,EACL,YAAY,EACb,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,oCAAoC,EACpC,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,yCAAyC,CAAC;AAMjD,MAAM,WAAW,qBAAqB;IACpC,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI,CAAC;CAC7C;AAED,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|
@@ -68,6 +68,7 @@ function generateBundleStats(info) {
|
|
|
68
68
|
// where each builder has different output path.
|
|
69
69
|
// Ideally, we should create the logging callback as a factory, but that would need a refactoring.
|
|
70
70
|
const runsCache = new Set();
|
|
71
|
+
const chunkHashCache = new Map();
|
|
71
72
|
function statsToString(stats, json, statsConfig, budgetFailures) {
|
|
72
73
|
if (!json.chunks?.length) {
|
|
73
74
|
return '';
|
|
@@ -82,10 +83,17 @@ function statsToString(stats, json, statsConfig, budgetFailures) {
|
|
|
82
83
|
let unchangedChunkNumber = 0;
|
|
83
84
|
let hasEstimatedTransferSizes = false;
|
|
84
85
|
const isFirstRun = !runsCache.has(json.outputPath || '');
|
|
86
|
+
const prevHashes = chunkHashCache.get(json.outputPath || '') ??
|
|
87
|
+
new Map();
|
|
88
|
+
const nextHashes = new Map();
|
|
85
89
|
for (const chunk of json.chunks) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
90
|
+
const key = chunk.id ?? chunk.names?.[0] ?? '';
|
|
91
|
+
const hash = chunk.hash ?? '';
|
|
92
|
+
nextHashes.set(key, hash);
|
|
93
|
+
// During first build we want to display all chunks.
|
|
94
|
+
// On rebuilds, skip chunks whose hash hasn't changed.
|
|
95
|
+
if (!isFirstRun && prevHashes.get(key) === hash) {
|
|
96
|
+
unchangedChunkNumber++;
|
|
89
97
|
continue;
|
|
90
98
|
}
|
|
91
99
|
const assets = json.assets?.filter((asset) => {
|
|
@@ -141,8 +149,8 @@ function statsToString(stats, json, statsConfig, budgetFailures) {
|
|
|
141
149
|
}
|
|
142
150
|
changedChunksStats.push(generateBundleStats({ ...chunk, rawSize, estimatedTransferSize }));
|
|
143
151
|
}
|
|
144
|
-
unchangedChunkNumber = json.chunks.length - changedChunksStats.length;
|
|
145
152
|
runsCache.add(json.outputPath || '');
|
|
153
|
+
chunkHashCache.set(json.outputPath || '', nextHashes);
|
|
146
154
|
const statsTable = (0, private_1.generateBuildStatsTable)(changedChunksStats, colors, unchangedChunkNumber === 0, hasEstimatedTransferSizes, budgetFailures);
|
|
147
155
|
// In some cases we do things outside of rspack context
|
|
148
156
|
// Such us index generation, service worker augmentation etc...
|
|
@@ -295,10 +303,16 @@ function generateBuildEventStats(rspackStats, options) {
|
|
|
295
303
|
let changedChunksCount = 0;
|
|
296
304
|
const allChunksCount = chunks.length;
|
|
297
305
|
const isFirstRun = !runsCache.has(rspackStats.outputPath || '');
|
|
306
|
+
const prevHashes = chunkHashCache.get(rspackStats.outputPath || '') ??
|
|
307
|
+
new Map();
|
|
298
308
|
const chunkFiles = new Set();
|
|
299
309
|
for (const chunk of chunks) {
|
|
300
|
-
if (!isFirstRun
|
|
301
|
-
|
|
310
|
+
if (!isFirstRun) {
|
|
311
|
+
const key = chunk.id ?? chunk.names?.[0] ?? '';
|
|
312
|
+
const hash = chunk.hash ?? '';
|
|
313
|
+
if (prevHashes.get(key) !== hash) {
|
|
314
|
+
changedChunksCount++;
|
|
315
|
+
}
|
|
302
316
|
}
|
|
303
317
|
if (chunk.initial) {
|
|
304
318
|
initialChunksCount++;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/angular-rspack",
|
|
3
|
-
"version": "22.7.0-beta.
|
|
3
|
+
"version": "22.7.0-beta.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"@ampproject/remapping": "2.3.0",
|
|
49
49
|
"@babel/core": "7.28.3",
|
|
50
50
|
"@discoveryjs/json-ext": "0.6.3",
|
|
51
|
-
"@nx/angular-rspack-compiler": "22.7.0-beta.
|
|
52
|
-
"@nx/devkit": "22.7.0-beta.
|
|
51
|
+
"@nx/angular-rspack-compiler": "22.7.0-beta.4",
|
|
52
|
+
"@nx/devkit": "22.7.0-beta.4",
|
|
53
53
|
"ansi-colors": "4.1.3",
|
|
54
54
|
"autoprefixer": "10.4.21",
|
|
55
55
|
"deepmerge": "^4.3.1",
|