Skip to content

Commit 60c30dd

Browse files
authored
fix: do not modify mf’s output config (#1322)
1 parent 30f4279 commit 60c30dd

File tree

9 files changed

+1194
-1128
lines changed

9 files changed

+1194
-1128
lines changed

packages/core/src/config.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,6 @@ export async function createConstantRsbuildConfig(): Promise<EnvironmentConfig>
590590
},
591591
output: {
592592
target: 'node',
593-
filenameHash: false,
594593
distPath: {
595594
js: './',
596595
jsAsync: './',
@@ -649,6 +648,9 @@ const composeFormatConfig = ({
649648
switch (format) {
650649
case 'esm':
651650
return {
651+
output: {
652+
filenameHash: false,
653+
},
652654
tools: {
653655
rspack: {
654656
module: {
@@ -693,6 +695,9 @@ const composeFormatConfig = ({
693695
};
694696
case 'cjs':
695697
return {
698+
output: {
699+
filenameHash: false,
700+
},
696701
tools: {
697702
rspack: {
698703
module: {
@@ -731,6 +736,9 @@ const composeFormatConfig = ({
731736
}
732737

733738
const config: EnvironmentConfig = {
739+
output: {
740+
filenameHash: false,
741+
},
734742
tools: {
735743
rspack: {
736744
module: {
@@ -774,6 +782,7 @@ const composeFormatConfig = ({
774782

775783
const config: EnvironmentConfig = {
776784
output: {
785+
filenameHash: false,
777786
minify: {
778787
jsOptions: {
779788
minimizerOptions: {
@@ -1133,7 +1142,8 @@ const composeOutputFilenameConfig = (
11331142
});
11341143

11351144
return {
1136-
config: finalConfig,
1145+
// Do not modify MF's output hash configuration.
1146+
config: format === 'mf' ? {} : finalConfig,
11371147
jsExtension: finalJsExtension,
11381148
dtsExtension,
11391149
};
@@ -1781,6 +1791,7 @@ async function composeLibRsbuildConfig(
17811791
multiCompilerIndex,
17821792
pkgJson,
17831793
);
1794+
17841795
const { entryConfig, outBase } = await composeEntryConfig(
17851796
config.source?.entry!,
17861797
config.bundle,

0 commit comments

Comments
 (0)