Developing code for Google Apps Script can be fun, but not being able to test things or use a regular javascript pipeline can be quite annoying.
This project uses a combination of
To create a workable javascript pipeline for your V8 Apps Script project.
First, enable the Google Apps Script API: https://script.google.com/home/usersettings
npm install
npm run clasp login # Setup clasp for pushing code to google
Create a .clasp.json
in the root of the project that looks like this
{
"scriptId": "[script id from url]",
"rootDir": "dist/"
}
Then, update the Apps Script Manifest located here: src/appsscript.json
src/addon.js is the main entrypoint of the application, add your code there!
Be sure to add functions that you want Google Apps Script to see to the global variable created at the top of the file.
global.newFunction = function() {
console.log("newFunction")
}
npm test
npm run deploy