Skip to content

Update README.md about TypeScript support & UMD bundle #1843

Closed
@Strift

Description

@Strift

Add mention about TypeScript support

Hey @bramses!

What version of TypeScript do you have? How does your tsconfig.json look like?

Your Node.js version is fine, we do only support Node.js versions that support the "exports" field (v14.13.0, v12.20.0), but officially we only test and support Maintenance and LTS versions of Node.js (so no End Of Life versions). (https://github.com/nodejs/Release?tab=readme-ov-file#release-schedule)

For TypeScript support (>=4.7) read more here: https://www.typescriptlang.org/docs/handbook/modules/reference.html#packagejson-exports
When moduleResolution is set to node16, nodenext, or bundler, and resolvePackageJsonExports is not disabled, TypeScript follows Node.js’s package.json "exports" spec when resolving from a package directory triggered by a bare specifier node_modules package lookup.

You probably need to set moduleResolution to node16, nodenext, or bundler.

If you don't want to read up about what to choose, just take a look at https://github.com/tsconfig/bases?tab=readme-ov-file#node-20-tsconfigjson
Or directly at the config: https://github.com/tsconfig/bases/blob/main/bases/node20.json

Take a look at this comment: #1690 (comment)

Originally posted by @flevi29 in #1838

Add mention about UMD bundle

As seen originally in #1836

Additionally

Any configuration/requirement changes for end users related to #1740

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions