Replies: 1 comment
-
@codecalm The author of this discussion mentioned the same errors that are exposed by the great publint library, specialized in errors in the package.json file: https://publint.dev/tabler-icons@1.35.0 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I mean, there is something wrong with the way you set up exports in your package.json.
How to import a single icon from this package?
The same applies to @tabler/icons-png, how to import any image? It doesn't work, while importing a single image works in every other project.
You need to give attention to this. Your tutorial in the readme.md doesn't work,
when I do: import {IconAbc} from '@tabler/icons/icons';
And
when I do: import {IconAbc} from '@tabler/icons';
I am using Vite as package builder. But this problem happens without Vite also.
Related, but not directly, is: considering that all projects are migrating to only .mjs instead of .cjs, it would be handy if you could simplify your package.json to potentially remove this complex exports and aliases for different formats, that is the cause of error. I refer to this:
"main": "dist/cjs/tabler-icons.js",
"main:umd": "dist/umd/tabler-icons.js",
"exports": {
"./": [
"./icons/"
]
},
"module": "dist/esm/tabler-icons.js",
Problem mentioned several times:
vitejs/vite#15550
vitejs/vite#3250
"@tabler/icons doesn't have icons/settings.svg specified in their exports field. So it is hidden from external users. Vite is working as expected."
https://github.com/vitejs/vite/issues?q=is%3Aissue+tabler+is%3Aclosed
Beta Was this translation helpful? Give feedback.
All reactions