Vite has an optimizeDeps pass that does not like that you can't import from @heroicons/react or @heroicons/vue directly. This is because we do not have a main / module / exports."." entry in our package.json. This was intentional because such an import is invalid. You must import from one of:
@heroicons/react/20/solid
@heroicons/react/24/solid
@heroicons/react/24/outline
@heroicons/vue/20/solid
@heroicons/vue/24/solid
@heroicons/vue/24/outline
However, because of this problem we need one to exist for Vite to not break if it decides to optimize deps and include @heroicons/react (or @heroicons/vue) either because there's many packages, because the user has forced them on for all packages, or it's been explicitly included by the user.
This PR solves this by adding root-level entry points for @heroicons/react and @heroicons/vue. If someone tries to use these imports directly we will throw an error at runtime letting them know the correct path(s) to import.
Vite has an
optimizeDeps
pass that does not like that you can't import from@heroicons/react
or@heroicons/vue
directly. This is because we do not have amain
/module
/exports."."
entry in our package.json. This was intentional because such an import is invalid. You must import from one of:@heroicons/react/20/solid
@heroicons/react/24/solid
@heroicons/react/24/outline
@heroicons/vue/20/solid
@heroicons/vue/24/solid
@heroicons/vue/24/outline
However, because of this problem we need one to exist for Vite to not break if it decides to optimize deps and include
@heroicons/react
(or@heroicons/vue
) either because there's many packages, because the user has forced them on for all packages, or it's been explicitly included by the user.This PR solves this by adding root-level entry points for
@heroicons/react
and@heroicons/vue
. If someone tries to use these imports directly we will throw an error at runtime letting them know the correct path(s) to import.Fixes #934