Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/zaki-yama/webpack-google-apps-script-template

Template for developing Google Apps Script with Webpack
https://github.com/zaki-yama/webpack-google-apps-script-template

google-apps-script webpack

Last synced: 4 months ago
JSON representation

Template for developing Google Apps Script with Webpack

Lists

README

        

Google Apps Script Template
===========================

## Installation

```zsh
$ npm install
# or yarn
```

## Authentication

If you've never installed `gapps` and authenticate it, please read [here](https://github.com/danthareja/node-google-apps-script#quickstart) and download your credentials, then run

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

(For Japanese, see [GoogleAppsScriptローカル開発用の公式CLI(node-google-apps-script)がついに登場したので試してみる - Qiita](http://qiita.com/zaki-yama/items/9a301542137febd8876c))

## Usage

```zsh
# 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.