I\'m trying to use ES6 in a Google Spreadsheet (in the script.google.com part). I\'m pretty new to JavaScript and maybe the error is trivial ...
I tried several of the suggested ways mentioned above. However, utilizing this plugin with webpack 2.X is the only thing that worked for me.
https://github.com/fossamagna/gas-webpack-plugin
Please Note: This does not yet work with webpack 4.X.
I could regurgitate their Readme.md here, but I find that unnecessary.
In a nutshell you need to add this plugin to your webpack config and then add functions to global. These functions get added as top level functions.