mdx-js / mdx

Markdown for the component era
https://mdxjs.com
MIT License
17.77k stars 1.14k forks source link

Fix ESM type import in Webpack loader #2452

Closed remcohaszing closed 8 months ago

remcohaszing commented 8 months ago

Initial checklist

Description of changes

TypeScript 5.3 introduced support for import attributes and resolution-mode. This can be used to import types from ESM files into CJS files without a @ts-ignore comment.

The @ts-ignore comment is stripped from generated type definitions, which leads to a type error for consumers. The module resolution mode is not, which fixes it for users using TypeScript 5.3 or greater.

vercel[bot] commented 8 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
mdx ✅ Ready (Inspect) Visit Preview Mar 5, 2024 1:27pm
wooorm commented 8 months ago

Thanks!