Exclude JSON from sourcemaps
I'm trying to exclude JSON files from sourcemaps - I've already looked at https://github.com/evanw/esbuild/issues/1685 and implemented the suggested solution - however this only works for JS files as you can't append a comment to a JSON file (esbuild complains about this if I do add the comment). Unfortunately these files are still added to the client sourcemap, making it quite large.
Is there a way to exclude JSON files from the sourcemap?
I guess you can just run a script after esbuild that replaces the json fields in sourcemap with null.
This would be tricky - since the filenames aren't retained - or if they are the order is lost - since the code mapping portion of the sourcemap contains hundreds of empty ;; segments.
Seems like a reasonable feature to add though, rather than forcing the use of an onLoad hook that modifies the code (which I have to believe is wildly inefficient) instead make it part of the return of the onResolve hook - excludeFromSourcemap: true (or similar)