This is a scaffold for writing Google Apps Script in TypeScript and building with webpack.
Japanese README
- Git
- Node.js 8.10.0 or higher
$ git clone https://github.com/jerrywdlee/typescript-gas-scaffold.git <YOUR-NEW-REPO-NAME>
$ cd <YOUR-NEW-REPO-NAME>
$ npm i
$ npm run reset
# It will delete exist .git folder and run git init
If you watnt to use watch mode,
$ npm run watch
Edit code in src/app.ts
(and/or other codes in /src
), then enjoy it ;)
Deploy by Google Clasp
May Need Enable the Apps Script API at https://script.google.com/home/usersettings
$ npm run clasp login
# OR
$ cd build/ && $(npm bin)/clasp login
Change code.gs
(or other name) generated automatically to bundle.gs
$ npm run clasp clone <scriptId>
# OR
$ cd build/ && $(npm bin)/clasp clone <scriptId>
$ npm run clasp pull
# OR
$ cd build/ && $(npm bin)/clasp pull
Need Do Clone
and Pull
first!
May need refresh work space to show change
$ npm run push
# OR
$ npm run clasp push
# OR
$ cd build/ && $(npm bin)/clasp push
If Clasp is configed, run npm run watch:push
will be faster.
- If want connect to Spreadsheets ect. Need run on dev console first and apply permission
- If want update your REST API, need update web app setting after deploy your app