A Rollup plugin that bundles JavaScript/TypeScript code into a single file compatible with Google Apps Script (GAS). Version 1.0.0 is stable; no release cadence documented. It transpiles imports/exports (ES modules) into a single script with a global namespace, which is required by GAS as it does not support modules natively. Key differentiator: integrates tightly with Rollup's build pipeline. Compared to alternatives like clasp or gas-webpack-plugin, it leverages Rollup's tree-shaking and plugin ecosystem.
npm install rollup-plugin-gasVerified import paths — ran on the pinned version, not inferred.
Shows how to configure Rollup with rollup-plugin-gas to bundle a JS file for Google Apps Script.
Add @rollup/plugin-typescript to plugins array before gas().
Use dynamic import() or switch to ESM configuration.
Update Rollup to version 1.x or later.
Avoid dynamic import() statements in your source code, or use a different plugin to replace them.
npm install rollup-plugin-gas --save-dev and ensure import path is 'rollup-plugin-gas'.
Use import gas from 'rollup-plugin-gas' (default import).
Ensure your Rollup config uses format: 'esm' or 'iife', and that you are not using require() in your code.