From 5b730f4b07b1beeeee5c036e3377d03bbb7c1d6f Mon Sep 17 00:00:00 2001 From: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Date: Wed, 4 Jan 2023 15:15:49 +0000 Subject: [PATCH] Configure babel to transform logical assignment (#24160) This should fix any future problems along the lines of https://github.com/matrix-org/matrix-js-sdk/pull/3022. --- babel.config.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/babel.config.js b/babel.config.js index 0c8d5affcd..da3942c6da 100644 --- a/babel.config.js +++ b/babel.config.js @@ -22,6 +22,13 @@ module.exports = { "@babel/plugin-proposal-object-rest-spread", "@babel/plugin-proposal-optional-chaining", "@babel/plugin-proposal-nullish-coalescing-operator", + + // transform logical assignment (??=, ||=, &&=). preset-env doesn't + // normally bother with these (presumably because all the target + // browsers support it natively), but they make our webpack version (or + // something downstream of babel, at least) fall over. + "@babel/plugin-proposal-logical-assignment-operators", + "@babel/plugin-syntax-dynamic-import", "@babel/plugin-transform-runtime", ],