Skip to content

Commit f27428b

Browse files
committed
fix(rspack): fix issue where optimization options are removed from rspack config (nrwl#31268)
1 parent c8a6ffb commit f27428b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/rspack/src/plugins/utils/apply-base-config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@ function applyNxIndependentConfig(
147147
...(config.ignoreWarnings ?? []),
148148
];
149149

150-
config.optimization = !isProd
151-
? undefined
152-
: {
150+
config.optimization =
151+
{
153152
...(config.optimization ?? {}),
153+
...(isProd ? {
154154
sideEffects: true,
155155
minimize:
156156
typeof options.optimization === 'object'
@@ -182,7 +182,7 @@ function applyNxIndependentConfig(
182182
runtimeChunk: isDevServer
183183
? config.optimization?.runtimeChunk ?? undefined
184184
: false,
185-
};
185+
} : {})};
186186

187187
config.stats = {
188188
hash: true,

0 commit comments

Comments
 (0)