exposed package.json in export map #349
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "patch-1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Motivation and context here:
https://github.com/snowpackjs/snowpack/discussions/1954#discussioncomment-203114
there is even a discussion to make
package.jsonto be a special case but it was closed :( https://github.com/nodejs/modules/issues/445In short, modern tooling need to be able to resolve
package.json, hence it needs to be added to the export map.The plan is for the packages (once split out of the monorepo) to have a regular main export. That would resolve this, right? In the meantime, I'm okay with merging a PR that explicitly adds package.json to the exports.
My understanding is that it is almost a requirement to list
package.jsonIf you useexportedmap. I’m not sure what is your vision for distribution. As a reference point preact lists a bunch of entry points for different formats via export map.From preact/package.json
https://github.com/preactjs/preact/blob/master/package.json
I assume with a single entry point you can just omit
exportedfield.The issue you linked mentions a workaround where they resolve
"."and then walk up the directory structure from there, which would be the reason why this doesn't cause problems with every singleexports-using package.There is nothing at
./in the current package though, so I don't think adding that export helps at all. Does it solve a particular problem?My understanding is that it can be needed for some tools. E.g. traverse the folder structure starting from
./I think only exposing package.json will solve snowpack issue, because it looks explicitly just for it.
I've merged the package.json part as
b2ca4c8Pull request closed