Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add section to explain importance and order of package.json #31

Open
AntonyFagundez opened this issue Apr 19, 2023 · 1 comment
Open

Comments

@AntonyFagundez
Copy link

Many libraries that supports many bundlers and type of apps like @mui. Not use the exports field.

They use a package.json inside of they components to specify, where is the module, the main, the types, etc. (module resolution)

It would be excellent if you can add a section for this, or I can make contribution with more info about that.

PD: Thanks for sharing this guide it's excellent.

@frehner
Copy link
Owner

frehner commented Apr 19, 2023

Many libraries that supports many bundlers and type of apps like https://github.com/mui. Not use the exports field.

Yup, that's likely because the exports field is fairly recent, and also adopting it is likely a breaking change.

They use a package.json inside of they components to specify, where is the module, the main, the types, etc. (module resolution)

It would be excellent if you can add a section for this, or I can make contribution with more info about that.

Yeah, this is a common pattern for libraries that don't support package exports.

I could be wrong, but I don't think this is necessarily best practices for "modern" bundling, however. I'm under the impression that it's better to use package exports nowadays.

I am open to seeing if that's not necessarily the case, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants