luxon
luxon copied to clipboard
[package.json] Add ./package.json to exports
This PR fixes the compatibility between react-native and the last luxon
versions (broken since v2.5.0).
It adds the package.json
to the exports section
"exports": {
".": {
"import": "./src/luxon.js",
"require": "./build/node/luxon.js"
},
+ "./package.json": "./package.json",
},
It is something you can find in other popular libraries that have to deal with multiple js environments and bundlers, such as react-native
.
Something similar happened to the uuidjs/uuid
repository:
This PR will close https://github.com/moment/luxon/issues/1238
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: hatem-72 (1bda23485131582703e56c2d034b7535f738b406)
Hi @icambron can this be merged?
Just merged the same fix here: https://github.com/nhost/nhost/pull/828.
I believe the bug is still here in version 3.0.1
.
I don't understand what this does, but I don't see an issue with exporting package.json
@icambron if you don't modify the file as suggested here it gives the following error :
warn Package luxon has been ignored because it contains invalid configuration.
Reason: Package subpath './package.json' is not defined by "exports" in /Users/project/node_modules/luxon/package.json