@rsbuild/webpack 1.4.1 → 1.4.3

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/index.cjs CHANGED
@@ -192,16 +192,11 @@ for(var __webpack_i__ in (()=>{
192
192
  }), compiler.hooks.watchRun.tap(HOOK_NAME, ()=>{
193
193
  context.buildState.status = 'building';
194
194
  }), compiler.hooks.invalid.tap(HOOK_NAME, ()=>{
195
- context.buildState.status = 'idle', context.buildState.hasErrors = !1;
196
- }), compiler.hooks.done.tap(HOOK_NAME, (stats)=>{
197
- let hasErrors = stats.hasErrors();
198
- context.buildState.hasErrors = hasErrors, context.buildState.status = 'done';
199
- let statsOptions = helpers.getStatsOptions(compiler), statsJson = stats.toJson({
200
- moduleTrace: !0,
201
- children: !0,
202
- preset: 'errors-warnings',
203
- ...statsOptions
204
- }), { message, level } = helpers.formatStats(statsJson, hasErrors);
195
+ context.buildState.stats = null, context.buildState.status = 'idle', context.buildState.hasErrors = !1;
196
+ }), compiler.hooks.done.tap(HOOK_NAME, (statsInstance)=>{
197
+ let stats = helpers.getRsbuildStats(statsInstance, compiler, context.action), hasErrors = statsInstance.hasErrors();
198
+ context.buildState.stats = stats, context.buildState.status = 'done', context.buildState.hasErrors = hasErrors;
199
+ let { message, level } = helpers.formatStats(stats, hasErrors);
205
200
  'error' === level ? core_.logger.error(message) : 'warning' === level && core_.logger.warn(message);
206
201
  }), 'dev' === context.action && helpers.registerDevHook({
207
202
  compiler,
@@ -240,7 +235,7 @@ for(var __webpack_i__ in (()=>{
240
235
  };
241
236
  let { stats } = await new Promise((resolve, reject)=>{
242
237
  compiler.run((err, stats)=>{
243
- err ? reject(err) : stats?.hasErrors() ? reject(Error('webpack build failed.')) : compiler.close((closeErr)=>{
238
+ err ? reject(err) : context.buildState.hasErrors ? reject(Error('webpack build failed.')) : compiler.close((closeErr)=>{
244
239
  closeErr && core_.logger.error(closeErr), resolve({
245
240
  stats
246
241
  });
package/dist/index.js CHANGED
@@ -154,16 +154,11 @@ async function createCompiler_createCompiler(options) {
154
154
  }), compiler.hooks.watchRun.tap(HOOK_NAME, ()=>{
155
155
  context.buildState.status = 'building';
156
156
  }), compiler.hooks.invalid.tap(HOOK_NAME, ()=>{
157
- context.buildState.status = 'idle', context.buildState.hasErrors = !1;
158
- }), compiler.hooks.done.tap(HOOK_NAME, (stats)=>{
159
- let hasErrors = stats.hasErrors();
160
- context.buildState.hasErrors = hasErrors, context.buildState.status = 'done';
161
- let statsOptions = helpers.getStatsOptions(compiler), statsJson = stats.toJson({
162
- moduleTrace: !0,
163
- children: !0,
164
- preset: 'errors-warnings',
165
- ...statsOptions
166
- }), { message, level } = helpers.formatStats(statsJson, hasErrors);
157
+ context.buildState.stats = null, context.buildState.status = 'idle', context.buildState.hasErrors = !1;
158
+ }), compiler.hooks.done.tap(HOOK_NAME, (statsInstance)=>{
159
+ let stats = helpers.getRsbuildStats(statsInstance, compiler, context.action), hasErrors = statsInstance.hasErrors();
160
+ context.buildState.stats = stats, context.buildState.status = 'done', context.buildState.hasErrors = hasErrors;
161
+ let { message, level } = helpers.formatStats(stats, hasErrors);
167
162
  'error' === level ? core_.logger.error(message) : 'warning' === level && core_.logger.warn(message);
168
163
  }), 'dev' === context.action && helpers.registerDevHook({
169
164
  compiler,
@@ -202,7 +197,7 @@ let build = async (initOptions, { watch, compiler: customCompiler } = {})=>{
202
197
  };
203
198
  let { stats } = await new Promise((resolve, reject)=>{
204
199
  compiler.run((err, stats)=>{
205
- err ? reject(err) : stats?.hasErrors() ? reject(Error('webpack build failed.')) : compiler.close((closeErr)=>{
200
+ err ? reject(err) : context.buildState.hasErrors ? reject(Error('webpack build failed.')) : compiler.close((closeErr)=>{
206
201
  closeErr && core_.logger.error(closeErr), resolve({
207
202
  stats
208
203
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/webpack",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "homepage": "https://rsbuild.rs",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,16 +29,16 @@
29
29
  "picocolors": "^1.1.1",
30
30
  "reduce-configs": "^1.1.1",
31
31
  "tsconfig-paths-webpack-plugin": "4.2.0",
32
- "webpack": "^5.101.3"
32
+ "webpack": "^5.102.1"
33
33
  },
34
34
  "devDependencies": {
35
- "@rslib/core": "0.14.0",
36
- "@types/node": "^22.18.6",
35
+ "@rslib/core": "0.15.0",
36
+ "@types/node": "^22.18.8",
37
37
  "ansi-escapes": "4.3.2",
38
38
  "cli-truncate": "2.1.0",
39
39
  "patch-console": "1.0.0",
40
- "typescript": "^5.9.2",
41
- "@rsbuild/core": "1.5.13",
40
+ "typescript": "^5.9.3",
41
+ "@rsbuild/core": "1.5.15",
42
42
  "@scripts/test-helper": "1.0.1"
43
43
  },
44
44
  "peerDependencies": {