Skip to content

validate-npm-package - use node -e instead of npm compilation script #90

@le-cong

Description

@le-cong

use a better approach to import the main entry point based on the package.json

in order to simplify the implementation and align with our coding standards, we'll check only limited places inside package.json for determining the entry point:

{
  "main": "index.mjs",                            <-- here
  "exports": {
    ".": {
      "types": "./dist-types/index.d.ts",
      "import": "./dist-mjs/index.mjs",     <-- and here
      "default": "./dist-mjs/index.mjs"
    }
  },
}

error will be reported if no entry point is found in the above locations.

for the details of all the available options, please refer to https://nodejs.org/api/packages.html#package-entry-points

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions