Should pass Array objects to dataToEsm
Currently according to source, if a parsed JSON were determined to be not an Object, as in Object.prototype.toString.call(data) !== '[object Object]', it will not be passed on to dataToEsm. However this behavior excludes the case when the JSON is an Array. Since by definition JSON can be an object or an array, I believe it's appropriate to modify the conditional to allow '[object Array]' or perhaps remove the block altogether. Right now, for instance, a formatted JSON array will not be compacted even if the option compact: true is provided since it does not go through dataToEsm. Thanks for consideration.
I'm also trying to import a json file which contains an array. It does not get outputted in the bundle. I also tried the fix in PR #48 but that did not seem to fix the issue. 🤔
I think I have a similar issue too. I have a few json files, and they contain arrays of objects.
when i run rollup -c i get (json plugin) SyntaxError: Unexpected token ; in JSON at ...
@lukastaegert sorry for bothering you. Maybe you can advice what we need to do?
Fix at #53