motdotla / dotenv

Loads environment variables from .env for nodejs projects.
https://www.dotenvx.com
BSD 2-Clause "Simplified" License
19.14k stars 855 forks source link

Update package.json #819

Closed vit100 closed 7 months ago

vit100 commented 7 months ago

Removed "main" key.

The "exports" provides a modern alternative to "main" allowing multiple entry points to be defined, conditional entry resolution support between environments, and preventing any other entry points besides those defined in "exports"

If both "exports" and "main" are defined, the "exports" field takes precedence over "main" in supported versions of Node.js.

motdotla commented 7 months ago

thank you for the PR but this will break for thousands (possibly even hundreds of thousands of people) on old versions of node still.

vit100 commented 7 months ago

should not as package.json clearly says "engines": { "node": ">=12" }, and node >12 supports "exports" key.

motdotla commented 7 months ago

indeed. you are right but we don't hold to it strictly. there are many companies still on older versions using this library so we try to avoid modern changes. for faster moving modern changes we now recommend dotenvx.

https://github.com/dotenvx/dotenvx