Open shmygol opened 5 months ago
Generally agreed! I'm waiting for your PullRequest!
I don't have much experience with esbuild, but it doesn't seem to be possible: https://github.com/evanw/esbuild/issues/294.
@shmygol Sorry, I understand what you are requesting. You want this plugin to also output JSDoc for functions implemented by the user. Is this correct?
Correct. It is essential, because custom formulas in Google Spreadsheets need JSDoc to support auto-completion and user documentation. Instead of using esbuild-gas-plugin
I ended up bundling the business logic with an esbulid parameter glabalName: 'Main'
and push the bundle together with an unmodified custom index.js
containing formulas and hooks required by GAS like this:
/**
* Hello World
*
* @param {string} name Your name
* @return {string}
*
* @customfunction
*/
function HELLO(name) {
return Main.hello(name);
}
It would be nice if JSDoc were preserved to enable autocompletion for custom functions.