Is your feature request related to a problem? Please describe.
The current implementation of useSanityQuery always enables resultSourceMap due to a hard-coded value:
|
resultSourceMap: 'withKeyArraySelector', |
When prerendering a website this causes the generated JSON payloads to become extremely large even when visual editing or live preview is not used.
Describe the solution you'd like to see
Make resultSourceMap configurable in useSanityQuery, for example via an option in the third argument or derived from module/runtime config.
This would allow disabling source maps in production / prerendered builds when visual editing is not needed, significantly reducing payload size.
Describe alternatives you've considered
- Using
transform option in the third argument of useSanityQuery to strip source map data manually.
- Avoiding
useSanityQuery entirely and falling back to useAsyncData with a custom Sanity client configuration.
Additional context
Is your feature request related to a problem? Please describe.
The current implementation of
useSanityQueryalways enablesresultSourceMapdue to a hard-coded value:sanity/src/runtime/composables/useSanityQuery.ts
Line 162 in 85233e5
When prerendering a website this causes the generated JSON payloads to become extremely large even when visual editing or live preview is not used.
Describe the solution you'd like to see
Make
resultSourceMapconfigurable inuseSanityQuery, for example via an option in the third argument or derived from module/runtime config.This would allow disabling source maps in production / prerendered builds when visual editing is not needed, significantly reducing payload size.
Describe alternatives you've considered
transformoption in the third argument ofuseSanityQueryto strip source map data manually.useSanityQueryentirely and falling back touseAsyncDatawith a custom Sanity client configuration.Additional context