Add `.cjs` support in the generated Metro config
leonardlib opened this issue · comments
Leonardo Lira Becerra commented
Hi, I have an issue while trying to bundle my miniapp with an external .cjs
module and I figured out that you should add that file extension in the generated metro config file.
Here is my error:
✖ error While trying to resolve module <module-name> from file <file-name>, the
package `<package>/package.json` was successfully found. However, this package
itself specifies a `main` module field that could not be resolved (`<package>/index.cjs`.
Indeed, none of these files exist:
✖
✖ * <package>/index.cjs(.native|.ios.js|.native.js|.js|.ios.json|.nati
ve.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.svg|.native.svg|.svg)
✖ * <package>/index.cjs/index(.native|.ios.js|.native.js|.js|.ios.json
|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.svg|.native.svg|.svg)