From 5b72ea050aad28e6c88693a6386e2e25c475b29b Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Wed, 19 Jun 2024 10:58:36 +0200 Subject: [PATCH] Set env.bugfixes by default --- src/preset.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/preset.ts b/src/preset.ts index 98165d9..74d4112 100644 --- a/src/preset.ts +++ b/src/preset.ts @@ -18,6 +18,13 @@ export const webpackFinal = async (config: Configuration, options: Options) => { const swcFinalOptions: SwcOptions = { ...swcOptions, + env: { + ...(swcOptions?.env ?? {}), + // Transpiles the broken syntax to the closest non-broken modern syntax. + // E.g. it won't transpile parameter destructuring in Safari + // which would break how we detect if the mount context property is used in the play function. + bugfixes: swcOptions?.env?.bugfixes ?? true, + }, jsc: { ...(swcOptions.jsc ?? {}), parser: swcOptions.jsc?.parser ?? {