Skip to content

Conversation

@h-a-n-a
Copy link
Contributor

@h-a-n-a h-a-n-a commented Jun 10, 2025

Summary

Export StatsErrorCode to support users filtering stats errors based on its code.
Check the original PR for the supported code: #10057

import { rspack, StatsErrorCode } from '@rspack/core';

rspack(<your-config-here>, (err, stats) => {
  if (err) {
    // handle error
    return;
  }

  // filter minification error
  const hasMinificationError = stats.toJson({ errors: true }).errors
    ?.some(e => e.code === StatsErrorCode.ChunkMinificationError);

  if (hasMinificationError) {
    // handle minification error
    return;
  }
});

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@netlify
Copy link

netlify bot commented Jun 10, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 6d3c494
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/6848294b739b100007ebc55f

@github-actions github-actions bot added release: feature release: feature related release(mr only) team The issue/pr is created by the member of Rspack. labels Jun 10, 2025
@h-a-n-a h-a-n-a requested a review from chenjiahan June 10, 2025 12:48
@h-a-n-a h-a-n-a enabled auto-merge (squash) June 10, 2025 12:54
@codspeed-hq
Copy link

codspeed-hq bot commented Jun 10, 2025

CodSpeed Performance Report

Merging #10624 will not alter performance

Comparing export-error-code (6d3c494) with main (dc0c44e)

Summary

✅ 12 untouched benchmarks

Copy link
Member

@chenjiahan chenjiahan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@h-a-n-a h-a-n-a merged commit 5604d0d into main Jun 10, 2025
41 checks passed
@h-a-n-a h-a-n-a deleted the export-error-code branch June 10, 2025 13:35
@chenjiahan
Copy link
Member

Our documentation need to be updated 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: feature release: feature related release(mr only) team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants