Skip to content

exports map should have a main entry point #67

@thescientist13

Description

@thescientist13

The current exports map configuration does not include a main entry point as a default resolution
https://github.com/lxsmnsyc/seroval/blob/main/packages/plugins/package.json#L53

Per the NodeJS docs, if additional subpath patterns are used, there should at least be a default entry point
https://nodejs.org/api/packages.html#subpath-exports

{
  "exports": {
    ".": "./index.js",
    "./submodule.js": "./src/submodule.js"
  }
}

Not having this this will cause APIs like import.meta.resolve to fail

ERROR (ERR_PACKAGE_PATH_NOT_EXPORTED): unable to resolve specifier => `seroval-plugins`

For comparison, the main seroval package has one


I think the simplest solution would be just pointing to the same entry point as import, already being used for ./web, e.g.

"exports": {
  ".": "./dist/esm/production/web.mjs",
  "./web": {
    // ...
  }
},

Happy to submit a PR if desired!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions