Skip to content

Declare package type and export "default" #134

@kraenhansen

Description

@kraenhansen

The package.json of the @callstack/polygen package use types or require as exports condition for all its exports, it should either dual-publish ESM files or use default instead of require:

"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js"
},
"./polyfill": {
"types": "./dist/polyfill.d.ts",
"require": "./dist/polyfill.js"
},
"./config": {
"types": "./dist/config.d.ts",
"require": "./dist/config.js"
},
"./package.json": "./package.json"
},

With the current situation, the latest version of Expo (SDK 53) and Metro (0.82.4) fails to import the polyfill:

iOS Bundling failed 271ms example/index.ts (549 modules)
Unable to resolve "@callstack/polygen/polyfill" from "example/App.tsx"

I suggest declaring the package "type": "commonjs" too.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions