@nx/angular-rspack 22.4.0-canary.20260120-e586896 → 22.4.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"angular-rspack-plugin.d.ts","sourceRoot":"","sources":["../../../src/lib/plugins/angular-rspack-plugin.ts"],"names":[],"mappings":"AAgBA,OAAO,EAEL,KAAK,QAAQ,EAEb,KAAK,oBAAoB,EAE1B,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,KAAK,WAAW,EAGhB,KAAK,oCAAoC,EAC1C,MAAM,WAAW,CAAC;AAUnB,qBAAa,mBAAoB,YAAW,oBAAoB;;gBAU5D,OAAO,EAAE,oCAAoC,EAC7C,WAAW,CAAC,EAAE,WAAW;IAuB3B,KAAK,CAAC,QAAQ,EAAE,QAAQ;
|
|
1
|
+
{"version":3,"file":"angular-rspack-plugin.d.ts","sourceRoot":"","sources":["../../../src/lib/plugins/angular-rspack-plugin.ts"],"names":[],"mappings":"AAgBA,OAAO,EAEL,KAAK,QAAQ,EAEb,KAAK,oBAAoB,EAE1B,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,KAAK,WAAW,EAGhB,KAAK,oCAAoC,EAC1C,MAAM,WAAW,CAAC;AAUnB,qBAAa,mBAAoB,YAAW,oBAAoB;;gBAU5D,OAAO,EAAE,oCAAoC,EAC7C,WAAW,CAAC,EAAE,WAAW;IAuB3B,KAAK,CAAC,QAAQ,EAAE,QAAQ;YAgVV,gBAAgB;CAkC/B"}
|
|
@@ -184,37 +184,50 @@ class AngularRspackPlugin {
|
|
|
184
184
|
if (!currentEmitCompilation)
|
|
185
185
|
return;
|
|
186
186
|
const budgets = tslib_1.__classPrivateFieldGet(this, _AngularRspackPlugin__options, "f").budgets;
|
|
187
|
-
const stats = statsValue.toJson();
|
|
188
187
|
const isPlatformServer = Array.isArray(compiler.options.target)
|
|
189
188
|
? compiler.options.target.some((target) => target === 'node' || target == 'async-node')
|
|
190
189
|
: compiler.options.target === 'node' ||
|
|
191
190
|
compiler.options.target === 'async-node';
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
191
|
+
// Early exit - skip expensive toJson() when budgets not needed
|
|
192
|
+
if (!budgets?.length || isPlatformServer) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
// Only serialize what's needed for budget checking
|
|
196
|
+
const stats = statsValue.toJson({
|
|
197
|
+
all: false,
|
|
198
|
+
assets: true,
|
|
199
|
+
chunks: true,
|
|
200
|
+
});
|
|
201
|
+
const budgetFailures = [...(0, private_1.checkBudgets)(budgets, stats)];
|
|
202
|
+
for (const { severity, message } of budgetFailures) {
|
|
203
|
+
switch (severity) {
|
|
204
|
+
case private_1.ThresholdSeverity.Warning:
|
|
205
|
+
(0, rspack_diagnostics_1.addWarning)(currentEmitCompilation, {
|
|
206
|
+
message,
|
|
207
|
+
name: PLUGIN_NAME,
|
|
208
|
+
hideStack: true,
|
|
209
|
+
});
|
|
210
|
+
break;
|
|
211
|
+
case private_1.ThresholdSeverity.Error:
|
|
212
|
+
(0, rspack_diagnostics_1.addError)(currentEmitCompilation, {
|
|
213
|
+
message,
|
|
214
|
+
name: PLUGIN_NAME,
|
|
215
|
+
hideStack: true,
|
|
216
|
+
});
|
|
217
|
+
break;
|
|
218
|
+
default:
|
|
219
|
+
(0, misc_helpers_1.assertNever)(severity);
|
|
213
220
|
}
|
|
214
221
|
}
|
|
215
222
|
});
|
|
216
223
|
compiler.hooks.afterDone.tap(PLUGIN_NAME, (stats) => {
|
|
217
|
-
|
|
224
|
+
// Get stats options - merge defaults with user's config if provided
|
|
225
|
+
const configStats = compiler.options.stats;
|
|
226
|
+
const defaultStatsOptions = (0, get_stats_options_1.getStatsOptions)(tslib_1.__classPrivateFieldGet(this, _AngularRspackPlugin__options, "f").verbose);
|
|
227
|
+
const statsOptions = typeof configStats === 'object' && configStats !== null
|
|
228
|
+
? { ...defaultStatsOptions, ...configStats }
|
|
229
|
+
: defaultStatsOptions;
|
|
230
|
+
(0, stats_1.rspackStatsLogger)(stats, statsOptions);
|
|
218
231
|
if (stats.hasErrors()) {
|
|
219
232
|
process.exit(1);
|
|
220
233
|
}
|
package/dist/lib/utils/stats.js
CHANGED
|
@@ -333,7 +333,7 @@ function generateBuildEventStats(rspackStats, options) {
|
|
|
333
333
|
};
|
|
334
334
|
}
|
|
335
335
|
function rspackStatsLogger(stats, statOptions, budgetFailures) {
|
|
336
|
-
const json = stats.toJson();
|
|
336
|
+
const json = stats.toJson(statOptions);
|
|
337
337
|
console.log(statsToString(stats, json, statOptions, budgetFailures));
|
|
338
338
|
if (typeof stats !== 'object') {
|
|
339
339
|
throw new Error('Invalid Rspack stats configuration.');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/angular-rspack",
|
|
3
|
-
"version": "22.4.0
|
|
3
|
+
"version": "22.4.0",
|
|
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.4.0
|
|
52
|
-
"@nx/devkit": "22.4.0
|
|
51
|
+
"@nx/angular-rspack-compiler": "22.4.0",
|
|
52
|
+
"@nx/devkit": "22.4.0",
|
|
53
53
|
"ansi-colors": "4.1.3",
|
|
54
54
|
"autoprefixer": "10.4.21",
|
|
55
55
|
"deepmerge": "^4.3.1",
|