npm i -g @google/clasp
npm i --save-dev webpack webpack-cli gas-webpack-plugin
scripts: {
"webpack": "webpack",
}
const path = require('path');
const GasPlugin = require('gas-webpack-plugin');
module.exports = {
mode: 'production',
entry: {
main: path.resolve('./src', 'Code.js')
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'Code.js',
library: {
name: 'Code',
type: 'var'
}
},
plugins: [new GasPlugin()]
}
AWS_ACCESS_KEY_ID=<YOUR ACCESS KEY> AWS_SECRET_ACCESS_KEY=<YOUR SECRET ACCESS KEY> ROLE_ARN=<YOUR ROLE ARN> npm test
(cd dist; clasp pull); npm run webpack; (cd dist; clasp push)