I pass import.meta.glob('./components/global/*.vue', {import: 'default', eager: true}), Import global components in batches for registration. After I publish the theme package to npm, then install the theme package through npm installation. The temporary file generated in dev mode is stored in .vitepress/cache/deps. However, the glob path is still ./components/global/*.vue, resulting in failure to install the expected load to the file, can it be automatically converted to like ... /.. /.. /node_modules/vitepress-theme-async/components/global/*.vue path.
At present, I am using the 'import.meta.env.dev' judgment, temporary processing, but vitepress working directory is variable, can not determine the user working directory level, is there a more reasonable way to handle this?
Describe the bug
I pass
import.meta.glob('./components/global/*.vue', {import: 'default', eager: true})
, Import global components in batches for registration. After I publish the theme package to npm, then install the theme package through npm installation. The temporary file generated in dev mode is stored in.vitepress/cache/deps
. However, the glob path is still./components/global/*.vue
, resulting in failure to install the expected load to the file, can it be automatically converted to like... /.. /.. /node_modules/vitepress-theme-async/components/global/*.vue
path.At present, I am using the 'import.meta.env.dev' judgment, temporary processing, but vitepress working directory is variable, can not determine the user working directory level, is there a more reasonable way to handle this?
Reproduction
https://stackblitz.com/edit/vite-fw9cs4?file=docs%2Fposts%2Fdemo.md
Expected behavior
import.meta.glob in dev mode, the path can be correctly converted
System Info
Additional context
No response
Validations