Modern build tool for Google Apps Script development with Bun
npm install gas-bun




Modern build tool for Google Apps Script development with Bun
- š Fast builds with Bun
- š¦ TypeScript support out of the box
- š Automatic export to global functions
- š ļø Project scaffolding CLI
- š Type-safe development with @types/google-apps-script
``bashCreate new project
bunx gas-bun create
Usage
$3
`bash
bunx gas-bun create
`This will:
1. Prompt for project name
2. Copy template files
3. Install dependencies
4. Build the project
5. Optionally create Apps Script project with clasp
$3
`bash
Build TypeScript to GAS
bunx gas-bun buildPush code to Apps Script
bunx gas-bun pushDeploy to Apps Script
bunx gas-bun deployOpen project in browser
bunx gas-bun open
`How It Works
$3
Input (
index.ts):`typescript
function myFunction() {
Logger.log('Hello via Bun!');
}export { myFunction };
`Output (
dist/Code.gs):`javascript
function myFunction() {
Logger.log('Hello via Bun!');
}
`$3
`
your-project/
āāā index.ts # Entry point
āāā public/
ā āāā appsscript.json # GAS configuration
āāā dist/
ā āāā Code.gs # Built output
ā āāā appsscript.json # Copied configuration
āāā package.json
āāā tsconfig.json
`API
$3
Build TypeScript code for Google Apps Script.
`typescript
import { buildGAS } from 'gas-bun';await buildGAS({
srcDir: '.',
distDir: './dist',
publicDir: './public',
entryFile: './index.ts',
outputFile: './dist/Code.gs',
packageJsonPath: './package.json',
minify: false,
});
`#### Options
| Option | Type | Description |
| ----------------- | --------- | ------------------------------------ |
|
srcDir | string | Source directory |
| distDir | string | Output directory |
| publicDir | string | Public assets directory (optional) |
| entryFile | string | Entry point file |
| outputFile | string | Output file path |
| packageJsonPath | string | Path to package.json |
| minify | boolean` | Enable minification (default: false) |- Bun
- clasp (optional, for deployment)
See CONTRIBUTING.md for development guidelines.
MIT