Fix path when auto decoding unions
I realized that, when using an autodecoder for unions and there's an error in one of the fields, the index of the field is not shown in the path which makes it more difficult to spot the problem. This fixes it.
I also took the chance to add a package.json in this PR with the sideEffects field set to false. In principle this should enable better tree shaking for Thoth.Json files.
Thank you Alfonso.
How is the sideEffects taking place ?
I mean Fable is the one responsible to compile the Thoth.Json library so I don't think webpack or any other bundler with see the package.json right ?
Fable compiles the F# files to JS and puts them together with other contents of the library (maybe js, css or in this case a package.json) in a directory within the .fable folder (which will be placed in outDir if set). Then the bundler kicks in and, at least webpack, if it detects the package.json with sideEffects: fals in that folder it will tree shake the files more aggressively. We added it recently for fable-library and it seems it helps a lot in reducing the output.
I see, thank you for the explanations :)