-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import.meta.glob()
not processed if living in node_modules/
#2390
Comments
https://vitejs.dev/guide/features.html#glob-import
It seems that the globbing from |
@ygj6 I guess it's a feature request then :-). This is a necessary feature to be able to build a framework like Nuxt on top of Vite. |
This reverts commit bb3cb87.
https://github.com/brillout/vite-fix-2390 if you need the fix before #2519 is merged & published. I'm using it for vite-plugin-ssr. |
tests vitejs#2390 and vitejs#1875 amongst others
tests vitejs#2390 and vitejs#1875 amongst others
tests vitejs#2390 and vitejs#1875 amongst others
tests vitejs#2390 and vitejs#1875 amongst others
tests vitejs#2390 and vitejs#1875 amongst others
tests vitejs#2390 and vitejs#1875 amongst others
tests vitejs#2390 and vitejs#1875 amongst others
tests vitejs#2390 and vitejs#1875 amongst others
tests vitejs#2390 and vitejs#1875 amongst others
tests vitejs#2390 and vitejs#1875 amongst others
Describe the bug
In the context of vite-plugin-ssr (or any SSR framework such as Nuxt),
import.meta.glob()
is called by SSR framework source code instead of being called by user-land source code. Consequently the file callingimport.meta.glob()
lives insidenode_modules/
.Because of the following,
import.meta.glob()
is not processed.Reproduction
npm init vite-plugin-ssr cd vite-ssr-project/ npm run build
The generated bundles at
dist/
will miss all theimport.meta.glob()
imports.If
vite-plugin-ssr
isln -s
'd then everything works as expect becausenode_modules
is not contained in the path anymore.I can provide a minimal repro if needed.
System Info
vite
version:2.0.5
Logs (Optional if provided reproduction)
N/A
The text was updated successfully, but these errors were encountered: