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
chore: prefix main
and module
fields with ./
#1451
Conversation
Esbuild ignored the browser field, causing jsdom inclusion which lead to errors. The file names in the mapping need to match exactly. Therefore using the ./ notation for the main and module entries. This is in line how the other package internal files are references in the package.json.
🦋 Changeset detectedLatest commit: b4b0156 The changes in this PR will be included in the next version bump. This PR includes changesets to release 35 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
here is how esbuild interprets For There the examples show that a path that doesn't start with There are many other places that use |
Hi. Thanks for your first PR ❤️ In addition to the esbuild link above, I also checked the documentation for some other tools. It seems that all tools agree that it's a good practice to add Node.js docs https://nodejs.org/docs/latest-v16.x/api/packages.html#main-entry-point-export
esbuild https://esbuild.github.io/api/#main-fields
Vite https://vitejs.dev/guide/build.html#library-mode
We have a script to generate these fields in |
Preconstruct doesn't like |
main
and module
fields with ./
@ocavue great, makes sense of course that the fields are autogenerated. I won't touch this PR anymore. In the unlikely case a crude workaround to unblock would be needed for esbuild, I've used btw just switched from slate in my project and feel so much more productive now. |
@ilkkao New version has been released. You might need to remove |
Description
Esbuild currently ignores the browser field in the core utilies package, causing jsdom inclusion which leads to errors (esbuild doesn't show the call stack so the snippet is not that informative) :
The file names in the mapping need to match exactly. Therefore I used the ./ notation for the main and module entries. This is in line how the other package internal files are references in the
package.json
.Checklist