TypeScriptToLua supports importing JSON files into your TypeScript. This is done by translating the JSON file to Lua and simply including this Lua file as part of the transpiler output.
Consider the following project files:
To be able to import JSON files you have to enable the
resolveJsonModule option in tsconfig.json, and set
moduleResolution to node:
The file containing JSON is just standard JSON:
Now to access your data, simply import it from your TS file: