Over the years, I've built an over-engineered package/framework to use React in apps-script add-ons. The current version is built with Pnpm + Vite + Rollup.
Rollup is used to bundle server-side code (apps script) and Vite for bundling client side html (Sidebar / modal) code.
It's inspired by two other starter kits ( this
and this )
Initially I was using Parcel (switched to vite now) to bundle client side code (outputs .html files with inlined js & css codes).
Later I added a way to upload js and css assets automatically to CDN during build.
As it's using Vite, any frameworks (supported by vite) should work.
Here's my workflow:
During development, I run "pnpm run gas:dev". It bundles server code and uploads to apps script, starts a local server to serve client code ... (it's actually complex). I can make updates to both server side and client side code and it will sync automatically in background.
To deploy, I run "pnpm run gas:deploy:staging" or "pnpm run gas:deploy:production" (I use two separate apps script projects). It will bundle and upload to apps-script and to the CDN.
Any add-ons built with this ?
It's currently not open-sourced. I was planning to open-source it, but never felt encouraged enough as there's already a lot of starter kits out there.
Also, it would be overkill for beginners.