Debugging plugins: how can I generate sourcemaps for a plugin?

I have a plugin (targeting Kibana v8.13.2). I am seeing an ambiguous error when using the plugin, but it only seems to be happening in production. I would like to generate javascript source maps alongside the plugin when it is built (I am using yarn build to build for production). How can I do this? I looked through the tasks in kbn-plugin-helpers but can't see any obvious options.