fix(rspack): fix issue with optimization options in rspack config (#31337)
## Current Behavior rspack.config.ts options related to optimizations are removed if the mode is not "production". This makes the compile fail for all non-production builds. ## Expected Behavior If mode isn't set to "production" configuration related to optimization should be passed through. ## Related Issue(s) Fixes #31268 #30292
This commit is contained in:
parent
9400f09603
commit
efc9c8d12a
@ -147,10 +147,10 @@ function applyNxIndependentConfig(
|
|||||||
...(config.ignoreWarnings ?? []),
|
...(config.ignoreWarnings ?? []),
|
||||||
];
|
];
|
||||||
|
|
||||||
config.optimization = !isProd
|
config.optimization = {
|
||||||
? undefined
|
|
||||||
: {
|
|
||||||
...(config.optimization ?? {}),
|
...(config.optimization ?? {}),
|
||||||
|
...(isProd
|
||||||
|
? {
|
||||||
sideEffects: true,
|
sideEffects: true,
|
||||||
minimize:
|
minimize:
|
||||||
typeof options.optimization === 'object'
|
typeof options.optimization === 'object'
|
||||||
@ -182,6 +182,8 @@ function applyNxIndependentConfig(
|
|||||||
runtimeChunk: isDevServer
|
runtimeChunk: isDevServer
|
||||||
? config.optimization?.runtimeChunk ?? undefined
|
? config.optimization?.runtimeChunk ?? undefined
|
||||||
: false,
|
: false,
|
||||||
|
}
|
||||||
|
: {}),
|
||||||
};
|
};
|
||||||
|
|
||||||
config.stats = {
|
config.stats = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user