A seed for an Apps Script project using typescript
- Clone this Repo and install via npm
- Create a new Apps Script. This can be easily accomplished from a Doc or Sheet or via Clasp as described at Clasp Codelab: Create a New Project. If using clasp, this will create new '.claps.json' and 'appsscript.json' files. Place these in the 'src/config' folder
- execute
npm run watch
which will watch files for changes - develop your application under the 'src' folder
- Function triggers (like onOpen) must be exported from index.ts to be correctly registered in the Apps Script
- Upload the built script 'dist/bundel.js'. This can simply be pasted into the online script editor, or better yet uploaded automatically via clasp as described at Clasp Codelab: Pulling & Pushing Files You can even have clasp watch your dist folder to automatically upload a new build. Note: for this to work, place '.claps.json' and 'appsscript.json' under 'src/config' and they will automatically be copied to 'dist'