Replies: 2 comments 1 reply
-
Short answer is: don't use it. That's the reason they are not properly exposed. Most of them are even marked as "private". Is there a particular utility from iTwinUI that you would benefit from? We already have plans to make a public |
Beta Was this translation helpful? Give feedback.
-
We ended up using But if Popover or it's alternative ends up in public, that's fine. Thanks |
Beta Was this translation helpful? Give feedback.
-
When publishing a package we build both esm and cjs versions.
We want to use some utils from iTwinUI.
We're supposed to import them from
@itwin/itwinui-react/esm/core/utils
and@itwin/itwinui-react/cjs/core/utils
If we import from
./esm/core/utils
we end up with cjs compiled code:require('@itwin/itwinui-react/esm/core/utils')
Which will import esm module, not cjs.
Maybe it's worth considering redirecting imports with "exports" field to appropriate folders, and allowing import without specifying type
@itwin/itwinui-react/core/utils
would import ->@itwin/itwinui-react/cjs/core/utils
or esm.Although I couldn't make this work in few quick tests...
I know that this solution would work for sure:
publishing single
dist
folderIt would contain
.mjs
and.cjs
filesthen exports property in package.json could look something like:
If imported from cjs project, it will include cjs files, if imported from esm project will import esm files automatically
This would be a breaking change, would have to release with major version
Beta Was this translation helpful? Give feedback.
All reactions