Currently, Google Apps Script does not support ES modules. Hence the typical export
/import
pattern cannot be used and will fail.
The trick here is to make sure not to export any functions in your entry point code, e.g. index.ts
, and to prevent any generation of export statement in the final bundle (see the custom rollup plugin in rollup.config.js.
- Add your script id to .clasp.json
- Put your code into index.ts
npm run build
npm run deploy