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 exports field #920

Merged
merged 6 commits into from
Jan 25, 2023
Merged

Add exports field #920

merged 6 commits into from
Jan 25, 2023

Conversation

thecrypticace
Copy link
Contributor

@thecrypticace thecrypticace commented Jan 24, 2023

Fixes #914

In most instances this isn't necessary except for SSR. And Vite even works around this problem for SSR bundles by doing some rewriting when the module is loaded. However, given that there are some places that need this it'll help make usage more consistent across environments.

You can no longer require() or import files directly from the package that are not covered by the exports field. However, all paths that were previously importable should be covered. We have covered the all components with and without an extension, the index file (with and without an extension), an implicit index export, legacy v1 imports, the package.json, etc…

@thecrypticace thecrypticace merged commit edb9526 into master Jan 25, 2023
@thecrypticace thecrypticace deleted the fix/add-exports-field branch January 25, 2023 17:00
@blowsie
Copy link

blowsie commented Feb 3, 2023

I beleive this commit breaks usage in nuxt3 with vite

@thecrypticace
Copy link
Contributor Author

@blowsie can you open an issue with a reproduction please? It shouldn't be a breaking change.

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

Successfully merging this pull request may close these issues.

Support ESM projects
2 participants