Dynamic import fails even if following all rules outlined in Rollup limitations doc #8424
Closed
7 tasks done
Labels
p2-edge-case
Bug, but has workaround or limited in scope (priority)
Describe the bug
I'm trying to dynamically import files with the format
\
./${import.meta.env.VITE_PROJECT_NAME}__site_config.json``, however I get a warning saying Vite cannot statically analyze the import. I'm following all the rules outlined in Rollup dynamic import limitations doc.If I change the the static portion of the string to be at the beginning of the path, however, like
\
./site_config__${import.meta.env.VITE_PROJECT_NAME}.json``, it works normally. Is there a reason for this?Reproduction
https://stackblitz.com/edit/vitejs-vite-ma2hgh?file=main.js
System Info
Used Package Manager
pnpm
Logs
Validations
The text was updated successfully, but these errors were encountered: