@@ -228,23 +228,6 @@ const swcReactLoaderConfig: SwcLoaderOptions = {
228
228
isModule : 'unknown' ,
229
229
} ;
230
230
231
- const minimizer = [
232
- new rspack . LightningCssMinimizerRspackPlugin ( ) ,
233
- new rspack . SwcJsMinimizerRspackPlugin ( {
234
- minimizerOptions : {
235
- compress : {
236
- // We are turning off these 3 minifier options because it has caused
237
- // unexpected behaviour. See the following issues for more details.
238
- // - https://github.com/swc-project/swc/issues/10822
239
- // - https://github.com/swc-project/swc/issues/10824
240
- reduce_vars : false ,
241
- inline : 0 ,
242
- collapse_vars : false ,
243
- } ,
244
- } ,
245
- } ) ,
246
- ] ;
247
-
248
231
/**
249
232
* Main Webpack config for Sentry React SPA.
250
233
*/
@@ -549,7 +532,22 @@ const appConfig: Configuration = {
549
532
} ,
550
533
551
534
// This only runs in production mode
552
- minimizer,
535
+ minimizer : [
536
+ new rspack . LightningCssMinimizerRspackPlugin ( ) ,
537
+ new rspack . SwcJsMinimizerRspackPlugin ( {
538
+ minimizerOptions : {
539
+ compress : {
540
+ // We are turning off these 3 minifier options because it has caused
541
+ // unexpected behaviour. See the following issues for more details.
542
+ // - https://github.com/swc-project/swc/issues/10822
543
+ // - https://github.com/swc-project/swc/issues/10824
544
+ reduce_vars : false ,
545
+ inline : 0 ,
546
+ collapse_vars : false ,
547
+ } ,
548
+ } ,
549
+ } ) ,
550
+ ] ,
553
551
} ,
554
552
devtool : IS_PRODUCTION ? 'source-map' : 'eval-cheap-module-source-map' ,
555
553
} ;
@@ -781,10 +779,8 @@ if (IS_UI_DEV_ONLY) {
781
779
rewrites : [ { from : / ^ \/ .* $ / , to : '/_assets/index.html' } ] ,
782
780
} ,
783
781
} ;
784
- appConfig . optimization = {
785
- runtimeChunk : 'single' ,
786
- minimizer,
787
- } ;
782
+ // Hot reloading breaks if we aren't using a single runtime chunk
783
+ appConfig . optimization ! . runtimeChunk = 'single' ;
788
784
}
789
785
790
786
if ( IS_UI_DEV_ONLY || SENTRY_EXPERIMENTAL_SPA ) {
0 commit comments