You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently, CJS has been added to this lib, which I am quite happy with. However, in my current project I'd like to use it with TypeScript where I ran into an issue.
When my IDE (VSCode) checks for module compatibility, it looks into the package.json of the library. Since the /types/ directory is located in the folder that has "type": "module" in the package.json, it will give me a warning that it'll be using ESM. Except this is not the case, when I ts-ignore this error the code transpiles fine:
Without ts-ignore
With ts-ignore
I can unfortunately not switch to ESM because of my difficult setup with other dependencies, and I am also not a fan of using ts-ignore to solve problems.
Is it an idea to make an import like import { Logger, ILogObj } from "tslog/cjs"; which has typings and "type": "commonjs" in the package.json? Or am I missing something here?
The text was updated successfully, but these errors were encountered:
I just made a simple logger till this is fixed/ someone knows a workaround, but I haven't spent much energy on trying anything since the project above is currently shelved 👍
Recently, CJS has been added to this lib, which I am quite happy with. However, in my current project I'd like to use it with TypeScript where I ran into an issue.
When my IDE (VSCode) checks for module compatibility, it looks into the package.json of the library. Since the /types/ directory is located in the folder that has "type": "module" in the package.json, it will give me a warning that it'll be using ESM. Except this is not the case, when I ts-ignore this error the code transpiles fine:
Without ts-ignore
With ts-ignore
I can unfortunately not switch to ESM because of my difficult setup with other dependencies, and I am also not a fan of using ts-ignore to solve problems.
Is it an idea to make an import like
import { Logger, ILogObj } from "tslog/cjs";
which has typings and "type": "commonjs" in the package.json? Or am I missing something here?The text was updated successfully, but these errors were encountered: