Skip to content

Update Rollup config for clasp v3 compatibility#44

Merged
k2tzumi merged 10 commits into
masterfrom
exciting-austin
Feb 1, 2026
Merged

Update Rollup config for clasp v3 compatibility#44
k2tzumi merged 10 commits into
masterfrom
exciting-austin

Conversation

@k2tzumi

@k2tzumi k2tzumi commented Feb 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Update Rollup configuration to work with clasp v3.x which no longer transpiles TypeScript
  • Auto-detect exported functions from src/Code.ts using TypeScript Compiler API
  • Generate global function wrappers in footer for GAS compatibility
  • Fix Makefile for clasp v3 commands and appsscript.json copying
  • Fix iframe sandbox issues in HTML templates

Changes

  • rollup.config.js: Use TypeScript Compiler API to automatically detect exported functions and generate footer with global function wrappers
  • Makefile: Update clasp commands for v3 (create-script, open-script, redeploy), add dist/appsscript.json dependency
  • src/Code.ts: Fix HTML template sandbox issues by using JavaScript onclick handlers instead of target="_parent"
  • src/appsscript.json: Update runtime version

Test plan

  • make build succeeds
  • npm test passes
  • make push deploys to GAS
  • make deploy creates new version
  • Web app URL shows doGet function works
  • Slack commands work correctly

🤖 Generated with Claude Code

k2tzumi and others added 10 commits January 31, 2026 14:10
- Change output format from IIFE to ESM to keep functions in global scope
- Add gasCompatibility plugin to remove export statements (GAS doesn't support ES modules)
- Add treeshake options to preserve all exports from entry point
- Update TypeScript compiler options for ESNext module

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use IIFE format with footer to expose global functions (doGet, doPost, jobEventHandler)
- Add rollup-plugin-cleanup to remove comments
- Remove custom gasCompatibility plugin in favor of standard Rollup features

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove rollup-plugin-cleanup and rollup-plugin-google-apps-script
- Use array-based gasEntryPoints for cleaner footer generation
- Remove unnecessary banner and sourcemap options

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
clasp requires appsscript.json in the rootDir (dist/) for proper deployment.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@k2tzumi k2tzumi merged commit 40c1cb9 into master Feb 1, 2026
3 checks passed
@github-actions github-actions Bot mentioned this pull request Feb 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant