This is an example code for writing Google Apps Script in TypeScript and building with webpack.
Please Read at this Japanease post.
- Node.js v8 or heigher
- clasp
$ git clone https://github.com/naoki-sawada/gas-typescript-webpack.git
After clone this repository,
$ cd gas-typescript-webpack
$ npm intall
(or yarn)
- Install the clasp.
$ npm i @google/clasp -g
- Login with your google account.
$ clasp login
- Create new Google Apps Script.
$ clasp create "My Script" --rootDir ./dist
$ npm build
$ npm run push
If you watnt to use watch mode, run the next command.
$ npm run watch
In this watch mode, the build file is automatically pushed when saving the contents in the src
folder.