Closed mshima closed 1 year ago
ESM only packages fails to find the types.
A copy of type file is required to make tsc succeed: https://github.com/jhipster/generator-jhipster/blob/main/jdl/chevrotain.d.ts
tsc
Reference for package.json exports field: https://www.typescriptlang.org/docs/handbook/esm-node.html#packagejson-exports-imports-and-self-referencing
"exports": { ".": { // Entry-point for TypeScript resolution - must occur first! "types": "./types/index.d.ts", // Entry-point for `import "my-package"` in ESM "import": "./esm/index.js", // Entry-point for `require("my-package") in CJS "require": "./commonjs/index.cjs", }, },
Thanks @mshima 👍
ESM only packages fails to find the types.
A copy of type file is required to make
tsc
succeed: https://github.com/jhipster/generator-jhipster/blob/main/jdl/chevrotain.d.tsReference for package.json exports field: https://www.typescriptlang.org/docs/handbook/esm-node.html#packagejson-exports-imports-and-self-referencing