sjdemartini / mui-tiptap

A Material UI (MUI) styled WYSIWYG rich text editor, using Tiptap
MIT License
319 stars 43 forks source link

Add typesVersions to package.json to support usage with `"node"` resolution #140

Closed sjdemartini closed 1 year ago

sjdemartini commented 1 year ago

In order to separately export from two different modules, "mui-tiptap" and "mui-tiptap/icons", typically our existing "exports" configuration in package.json would be sufficient. However, it turns out that this only supports importing the non-root module in a TS application if the consuming package that installs mui-tiptap uses moduleResolution of Node16, NodeNext, bundler, etc. but not node (the default, and the option suggested by TS in their official docs here https://www.typescriptlang.org/docs/handbook/module-resolution.html#module-resolution-strategies).

As a (semi-hacky) workaround, we define typesVersions so that we can be compatible with node/node10 resolution in consuming packages for our separate "mui-tiptap/icons" module.

Some resources related to this: