-
I am currently using i18next-resources-to-backend and here's my code
and for some add reasons, the files in the folders are failing to load under Unknown variable dynamic import. |
Beta Was this translation helpful? Give feedback.
Answered by
chenxch
Nov 13, 2022
Replies: 1 comment 1 reply
-
My approach is to use the e.g. const modules = import.meta.glob('./assets/locales/**/*.json')
modules[`./${language}/${namespace}.json`]() |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
lonelil
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My approach is to use the
import.meta.glob()
method to get themodules
first, and then go to themodules
to get the correspondingimport
to execute according to the actual needs.e.g.