Skip to content

Commit 388367d

Browse files
author
yourtion
committed
fix: match webpack version
1 parent aa81dc4 commit 388367d

File tree

1 file changed

+6
-19
lines changed

1 file changed

+6
-19
lines changed

packages/rspack-plugin/src/rspack-bundle-analysis/rspackBundleAnalysisPlugin.ts

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -80,25 +80,12 @@ class RspackBundleAnalysisPlugin {
8080
async () => {
8181
this.output.setBundleName(this.output.originalBundleName);
8282

83+
// Removed automatic suffix addition to match webpack plugin behavior
84+
// This ensures the bundle name matches what users configure in Codecov settings
85+
// Previously, this was adding -cjs or -esm suffixes which caused platform recognition issues
86+
//
8387
// Rspack base chunk format options: https://rspack.dev/config/output/#outputchunkformat
84-
if (typeof compilation.outputOptions.chunkFormat === "string") {
85-
if (compilation.name && compilation.name !== "") {
86-
this.output.setBundleName(
87-
`${this.output.bundleName}-${compilation.name}`,
88-
);
89-
}
90-
91-
let chunkFormat = compilation.outputOptions.chunkFormat;
92-
if (chunkFormat === "commonjs") {
93-
chunkFormat = "cjs";
94-
} else if (chunkFormat === "module") {
95-
chunkFormat = "esm";
96-
}
97-
98-
this.output.setBundleName(
99-
`${this.output.bundleName}-${chunkFormat}`,
100-
);
101-
}
88+
10289

10390
const compilationStats = compilation.getStats().toJson({
10491
assets: true,
@@ -109,7 +96,7 @@ class RspackBundleAnalysisPlugin {
10996
});
11097

11198
this.output.bundler = {
112-
name: "rspack",
99+
name: "webpack", // Use "webpack" for Codecov platform compatibility
113100
version: rspack.version,
114101
};
115102

0 commit comments

Comments
 (0)