Closed d-w-d closed 3 years ago
Never mind. It does accept arrays; however, the output message was misleading, the actual problem is that the final object within the array had a trailing comma. So whereas the message suggested that the problem was due to misconfiguration with importing json, the actual problem was invalid json formatting.
Current Behavior
importing a json file with top-level array as follows within a
.ts
file:... leads to the following error when I run
tsdx build
:When I wrap the array in the json with
{"data":[]}
, it works. JSON is supposed to allow for arrays at root, and not require one to have access to the JSON file in order to wrap it as an object at root.Expected behavior
imports JSON as array on build without error.
Suggested solution(s)
Not sure -- might be a default rollup config.
Your environment