diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 6e6720bbf11..00000000000 --- a/.babelrc +++ /dev/null @@ -1,22 +0,0 @@ -{ - "sourceMaps": true, - "presets": [ - [ - "@babel/preset-env", - { - "targets": { - "node": 10 - }, - "modules": "commonjs" - } - ], - "@babel/preset-typescript" - ], - "plugins": [ - "@babel/plugin-proposal-numeric-separator", - "@babel/plugin-proposal-class-properties", - "@babel/plugin-proposal-object-rest-spread", - "@babel/plugin-syntax-dynamic-import", - "@babel/plugin-transform-runtime" - ] -} diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 00000000000..6b39ec8271b --- /dev/null +++ b/babel.config.js @@ -0,0 +1,26 @@ +module.exports = { + sourceMaps: true, + presets: [ + [ + "@babel/preset-env", + { + targets: { + esmodules: true, + }, + // We want to output ES modules for the final build (mostly to ensure that + // async imports work correctly). However, jest doesn't support ES modules very + // well yet (see https://github.com/jestjs/jest/issues/9430), so we use commonjs + // when testing. + modules: process.env.NODE_ENV === "test" ? "commonjs" : false, + }, + ], + "@babel/preset-typescript", + ], + plugins: [ + "@babel/plugin-proposal-numeric-separator", + "@babel/plugin-proposal-class-properties", + "@babel/plugin-proposal-object-rest-spread", + "@babel/plugin-syntax-dynamic-import", + "@babel/plugin-transform-runtime", + ], +}; diff --git a/src/models/MSC3089TreeSpace.ts b/src/models/MSC3089TreeSpace.ts index 76aae65588c..6dc1b6fbb63 100644 --- a/src/models/MSC3089TreeSpace.ts +++ b/src/models/MSC3089TreeSpace.ts @@ -35,7 +35,7 @@ import { ISendEventResponse } from "../@types/requests"; import { FileType } from "../http-api"; import { KnownMembership } from "../@types/membership"; import { RoomPowerLevelsEventContent, SpaceChildEventContent } from "../@types/state_events"; -import { EncryptedFile, FileContent } from "../@types/media"; +import type { EncryptedFile, FileContent } from "../@types/media"; /** * The recommended defaults for a tree space's power levels. Note that this