Skip to content

Commit 2eca82b

Browse files
fix: adds a package.json for the native sub-path to properly resolve imports in metro (#2494)
1 parent 244174b commit 2eca82b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"react-native": "native/index.cjs.js",
3131
"sideEffects": false,
3232
"scripts": {
33-
"build": "rimraf dist && yarn typegen && rollup -c && yarn copy",
33+
"build": "rimraf dist && yarn typegen && rollup -c && yarn copy && yarn copy:native",
3434
"prepare": "yarn build && husky",
3535
"eslint": "eslint --fix .",
3636
"eslint:ci": "eslint .",
@@ -42,6 +42,7 @@
4242
"storybook": "cross-env NODE_OPTIONS=\"--openssl-legacy-provider\" storybook dev -p 6006",
4343
"build-storybook": "cross-env NODE_OPTIONS=\"--openssl-legacy-provider\" storybook build",
4444
"copy": "copyfiles package.json README.md LICENSE dist && json -I -f dist/package.json -e \"this.private=false; this.devDependencies=undefined; this.optionalDependencies=undefined; this.scripts=undefined; this.husky=undefined; this.prettier=undefined; this.jest=undefined; this['lint-staged']=undefined;\"",
45+
"copy:native": "copyfiles -u 2 src/native/package.json dist/native",
4546
"release": "semantic-release"
4647
},
4748
"dependencies": {

src/native/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"main": "index.cjs.js",
3+
"module": "index.js",
4+
"types": "index.d.ts"
5+
}

0 commit comments

Comments
 (0)