shultz
shultz11mo ago

setting module scope variable based on module import path

I have a big utilities file with many helper functions, mostly arround html parsing. Many of which take a locale argument ("en-UK"). The importing module knows the locale, so I would like to set globalThis.defaultLocale via the import path, something like import { util } from '/utilities.ts?locale=en-US'. Is it possible without generating the files per locale or invoking some "setDefualtLocale()" function at every importing module?
0 Replies
No replies yetBe the first to reply to this messageJoin