Skip to content

Commit

Permalink
fix(package.json): add package.json to exports
Browse files Browse the repository at this point in the history
If you are using bundlers like metro in rn-native (or tools that make use of metainformation of packages) you will recieve an import warning like:
```
warn Package pretty-bytes has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /Users/****/Applications/****/****/app/node_modules/pretty-bytes/package.json
```

There was a similar Issue in `uuidjs`, for discussion you can see this issue uuidjs/uuid#444 (comment)
  • Loading branch information
tastydev committed Nov 30, 2022
1 parent 6860747 commit 3bd2dc0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion package.json
Expand Up @@ -11,7 +11,10 @@
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"exports": {
".": "./index.js",
"./package.json": "./package.json"
},
"types": "./index.d.ts",
"engines": {
"node": "^14.13.1 || >=16.0.0"
Expand Down

0 comments on commit 3bd2dc0

Please sign in to comment.