Skip to content

Need a valid ESM entry point in package.json #280

Open
@kingyue737

Description

@kingyue737

Although we already have module: dist/index.mjs, Node.js doesn't recognize the "module" field. Instead, we should use "exports" to increase compatibility with it. So we can use it on the server side. For example:

{
  "name": "expr-eval",
  "exports": {
    ".": {
      "types": "./parser.d.ts",
      "import": "./dist/index.mjs",
      "require": "./dist/bundle.js"
    }
  }
}

check here: https://publint.dev/[email protected]
check also: https://arethetypeswrong.github.io/?p=expr-eval%402.0.2

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