Skip to content

Commit 149ae73

Browse files
authored
fix(react-native): package.json should declare esm format (#1322)
This PR should address #1321 The change should be safe as, per the issue, downstream consumers should not be able to use `reqire` due to everything being in `esm` syntax. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Moderate risk because changing `package.json` `type` and Babel config module syntax can affect how tooling and downstream bundlers/loaders resolve and execute the package. > > **Overview** > Makes the React Native SDK explicitly ESM by switching `package.json` `type` from `commonjs` to `module`. > > Updates `babel.config.js` to use ESM syntax (`export default`) to align with the package’s module format. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit f2b2634. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 487182b commit 149ae73

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module.exports = {
1+
export default {
22
presets: ['module:metro-react-native-babel-preset'],
33
};

packages/sdk/react-native/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"launchdarkly",
1414
"react-native"
1515
],
16-
"type": "commonjs",
16+
"type": "module",
1717
"main": "./dist/src/index.js",
1818
"types": "./dist/src/index.d.ts",
1919
"exports": {

0 commit comments

Comments
 (0)