doug-wade / tybalt

A library for creating web components
MIT License
5 stars 3 forks source link

esbuild-plugin type interpreted as esm with require #585

Open doug-wade opened 9 months ago

doug-wade commented 9 months ago

We're getting the following issue from publint

The types is interpreted as ESM when resolving with the "require" condition. This causes the types to only work when dynamically importing the package, even though the package exports CJS. Consider splitting out two "types" conditions for "import" and "require", and use the .cts extension, e.g. pkg.exports["."].require.types: "./dist/types/index.d.cts" (More info)

See https://publint.dev/@tybalt/esbuild-plugin@0.1.6 for details