We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 25f9556 commit b7a08cdCopy full SHA for b7a08cd
packages/react-native-builder-bob/src/utils/compile.ts
@@ -69,7 +69,9 @@ export default async function compile({
69
70
await fs.mkdirp(output);
71
await fs.writeJSON(path.join(output, 'package.json'), {
72
- type: modules === 'commonjs' ? 'commonjs' : 'module',
+ // Treat code with ESM syntax as CommonJS if `esm` is not enabled
73
+ // This maintain compatibility with code written for CommonJS
74
+ type: modules === 'commonjs' || !esm ? 'commonjs' : 'module',
75
});
76
77
await Promise.all(
0 commit comments