zaki-yama / webpack-google-apps-script-template

Template for developing Google Apps Script with Webpack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Google Apps Script Template

Installation

$ npm install
# or yarn

Authentication

If you've never installed gapps and authenticate it, please read here and download your credentials, then run

$ npm run auth -- [path/to/credentials.json]

(For Japanese, see GoogleAppsScriptローカル開発用の公式CLI(node-google-apps-script)がついに登場したので試してみる - Qiita)

Usage

# Open your GAS(Google Apps Script) file and get fileId.
# (fileId is like https://script.google.com/d/[fileId]/edit)
# Pass it to `init` command.
$ npm run init -- [fileId]

# Bundle scripts under lib/ directory and generate src/bundle.js.
$ npm run build

# Upload src/bundle.js to GAS.
$ npm run upload

# Run ESLint
$ npm run lint

# Watch mode: watches file updates under `lib/` directory, re-build and upload automatically.
$ npm run watch

Load environment variables

If you use environment variables (such as process.env.FOO), Create .env and define them as KEY=VALUE format.

About

Template for developing Google Apps Script with Webpack


Languages

Language:JavaScript 100.0%