taoqf / node-html-parser

A very fast HTML parser, generating a simplified DOM, with basic element query support.
MIT License
1.12k stars 112 forks source link

Missing declaration file for ESM #191

Closed f4Ro closed 2 years ago

f4Ro commented 2 years ago

When using ESM instead of CommonJS modules, TypeScript will look for an index.d.ts file in /esm/index.d.ts by default. As this file does not exist, TS gives an error for missing declarations.

A possible is overriding the declaration path in tsconfig.json which could look like this

{
    "baseUrl": "node_modules",
    "paths": {
      "node-html-parser": ["node-html-parser/dist/index.d.ts"]
    }
}