mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 14:03:22 +08:00
FIX: Adjust swc minify options for Safari 15 support (#28098)
By default, the swc minifier seems to unwrap 'unneeded' IIFE. That means it was undoing the 'bugfix' transformation we have for class fields in Safari 15. Disabling the 'inline' and 'reduce_funcs' options seems to stop this behavior.
This commit is contained in:
parent
cec8445f14
commit
d141adb872
|
@ -145,6 +145,14 @@ module.exports = function (defaults) {
|
|||
minimizer: [
|
||||
new TerserPlugin({
|
||||
minify: TerserPlugin.swcMinify,
|
||||
terserOptions: {
|
||||
compress: {
|
||||
// Stop swc unwrapping 'unnecessary' IIFE wrappers which are added by Babel
|
||||
// to workaround a bug in Safari 15 class fields.
|
||||
inline: false,
|
||||
reduce_funcs: false,
|
||||
},
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user