Dynamic Imports of JSON files

So I get a lot of data as well structured JSON. I can use that in code by the…

import locationObectArray from 'public/locationsAll.json

… at the top of the file and all is good [fyi: the file where this works is a .js file inside ‘public’ as well].

However, importing ‘All’ starts to feel bloated and just clumsy. Thus, I attempted to gather the JSON based on a parameter (for the example above, ‘locations’, I might provide a ‘RegionKey’ as a parameter and only load the indicated Region’s data. Also, in this way the JSON itself is properly ‘encapsulated’ by region.

So I coded up some Dynamic Import Code… and in the WiX Editor the word ‘import’ turns red, when I hover over it and it displays the message:

“Dynamic imports are only supported when the ‘–module’ flag is set to ‘es2020’, ‘esnext’, ‘commonjs’, ‘amd’, ‘system’, or ‘umd’.”

I tend to get flummoxed by settings and such, and I am also ignorant of the WiX-Specific allowances for such things, and thus I tend to stay as vanilla as possible.

Yet this ability would be extremely useful. Certainly for this specific use case, as well as many others. Indeed, even when building based on data that will eventually become dynamic (by any manner of mechanisms… collection, api, etc) when testing sometimes putting some starting data into a JSON file and using it as if it were dynamically collected is very useful.

So my question is (I know, “Finally!”):

Does WiX support adjusting the --module flag, and how would one do so?

I do believe I have searched this forum, Velo API Reference - Wix.com and the google-verse as a whole and could not find an answer, so I hope you all can help.

=====

I am also considering using getJSON() to a google drive, but that seems like swatting a fly with a hammer, especially when a Static Import of JSON works so smoothly.

As always, Thanks In Advance.

Regards,
Brad