From 432aaa46d548728145a3af44245d9cc110ae180e Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 26 Jun 2024 17:45:55 +0100 Subject: [PATCH 1/2] Declare matrix-js-sdk as an ES module --- scripts/switch_package_to_release.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/switch_package_to_release.js b/scripts/switch_package_to_release.js index 2ef9bb09cb2..353840d4d92 100755 --- a/scripts/switch_package_to_release.js +++ b/scripts/switch_package_to_release.js @@ -11,6 +11,11 @@ async function main() { pkgJson[field] = pkgJson["matrix_lib_" + field]; } } + + // matrix-js-sdk is built into ECMAScript modules. Make sure we declare it as such. + // See https://nodejs.org/api/packages.html#type. + pkgJson["type"] = "module"; + await fsProm.writeFile(PKGJSON, JSON.stringify(pkgJson, null, 2)); } From 434e381b72afd8cac296245debd4bbef7318f816 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 26 Jun 2024 17:55:00 +0100 Subject: [PATCH 2/2] Rename `babel.config.js` to show it is a CommonJS module ... otherwise it gets broken by `scripts/switch_package_to_release.js` --- babel.config.js => babel.config.cjs | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename babel.config.js => babel.config.cjs (100%) diff --git a/babel.config.js b/babel.config.cjs similarity index 100% rename from babel.config.js rename to babel.config.cjs