You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-25 05:23:13 +03:00
* Declare matrix-js-sdk as an ES module * Rename `babel.config.js` to show it is a CommonJS module ... otherwise it gets broken by `scripts/switch_package_to_release.js`
23 lines
632 B
JavaScript
Executable File
23 lines
632 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
const fsProm = require("fs/promises");
|
|
|
|
const PKGJSON = "package.json";
|
|
|
|
async function main() {
|
|
const pkgJson = JSON.parse(await fsProm.readFile(PKGJSON, "utf8"));
|
|
for (const field of ["main", "typings"]) {
|
|
if (pkgJson["matrix_lib_" + field] !== undefined) {
|
|
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));
|
|
}
|
|
|
|
main();
|