Skip to content

Instantly share code, notes, and snippets.

View JefCurtis's full-sized avatar
🎄
I may be slow to respond.

Jef Curtis JefCurtis

🎄
I may be slow to respond.
View GitHub Profile
@JefCurtis
JefCurtis / .gitignore
Last active September 12, 2018 17:31
Git ignore file
config/dev/
@JefCurtis
JefCurtis / package_V3.json
Last active September 12, 2018 18:06
Gmail add-on: Add production build script command
{
"scripts": {
"build:prod": "DEPLOY_ENV=prod webpack --config config/webpack/webpack.config.js",
"build": "DEPLOY_ENV=dev webpack --watch --config config/webpack/webpack.config.js",
"sync": "cd build/ && clasp push"
}
},
@JefCurtis
JefCurtis / webpack_v5.config.js
Last active September 12, 2018 18:01
Gmail add-on: Copy clasp.json file to the build directory
const { env } = require("process");
const deployEnv = env.DEPLOY_ENV || "dev";
[...]
module.exports = {
[...]
plugins: [
new CopyWebpackPlugin([
{ from: join(root, `config/${deployEnv}/.clasp.json`), to: ".", ToType: "file" },
]),
@JefCurtis
JefCurtis / package_v2.json
Last active September 12, 2018 07:19
Gmail add-on: Add sync and push command
{
"scripts": {
"sync": "DEPLOY_ENV=dev webpack --watch --config config/webpack/webpack.config.js",
"push": "cd build/ && clasp push"
}
}
@JefCurtis
JefCurtis / webpack_v4.config.js
Last active September 12, 2018 17:34
Gmail add-on: Copy Webpack plugin. Hook after emit.
const exec = require("child_process").exec;
[...]
module.exports = {
[...]
plugins: [
[...]
new CopyWebpackPlugin([
{ from: join(root, "config/dev/.clasp.json"), to: ".", ToType: "file" },
]),
{
@JefCurtis
JefCurtis / .clasp.json
Last active September 4, 2018 04:57
Gmail add-on: Clasp JSON file
{
"scriptId":"10r3UYeLI…"
}
@JefCurtis
JefCurtis / webpack_v3.config.js
Last active September 12, 2018 16:28
Gmail add-on: Add HTML Webpack plugin for AppsScript template
const HtmlWebpackPlugin = require("html-webpack-plugin");
[...]
module.exports = {
[...]
plugins: [
new HtmlWebpackPlugin({
filename: "appsscript.json",
template: join(root, "config", "appsscript.json.ejs"),
chunks: [],
@JefCurtis
JefCurtis / appsscript.json.ejs
Created September 4, 2018 04:54
Gmail add-on: AppsScript JSON template
{
"oauthScopes": [
"https://www.googleapis.com/auth/gmail.addons.execute",
"https://www.googleapis.com/auth/gmail.readonly"
],
"gmail": {
"name": "<%= htmlWebpackPlugin.options.addon.name %>",
"logoUrl": "https://i.imgur.com/Em0d7Tc.png",
"contextualTriggers": [{
"unconditional": {
@JefCurtis
JefCurtis / package.json
Created September 4, 2018 04:37
Gmail add-on: Getting started
{
"scripts": {
"build": "DEPLOY_ENV=dev webpack --watch --config config/webpack/webpack.config.js",
}
}
@JefCurtis
JefCurtis / tsconfig.json
Last active September 4, 2018 04:58
Gmail add-on: TypeScript configuration
{
"compilerOptions": {
"outDir": "./build",
"baseUrl": ".",
"noImplicitAny": true,
"sourceMap": true,
"strictNullChecks": false,
"noImplicitThis": true,
"noEmitOnError": true,
"target": "ES5",