{"id":25614,"library":"gas-build","title":"gas-build","description":"ESBuild plugin and CLI (v0.0.3) for bundling modern TypeScript/JavaScript code into Google App Script (GAS). Combines ESBuild bundling with transformations required by GAS runtime (e.g., handling of `google.script.run`, `ScriptApp`). Peer dependency on `esbuild` ^0.24.2. Differentiator: no need for separate GAS-specific transpilation steps; single pass via ESBuild plugin. Actively maintained by Salsita.","status":"active","version":"0.0.3","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/salsita/gas-build","tags":["javascript","typescript"],"install":[{"cmd":"npm install gas-build","lang":"bash","label":"npm"},{"cmd":"yarn add gas-build","lang":"bash","label":"yarn"},{"cmd":"pnpm add gas-build","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; provides the core bundler","package":"esbuild","optional":false}],"imports":[{"note":"This is a named export, not a default export.","wrong":"import gasBuildPlugin from 'gas-build'","symbol":"gasBuildPlugin","correct":"import { gasBuildPlugin } from 'gas-build'"},{"note":"For CommonJS, destructure the named export. Do not use .default.","wrong":"const gasBuildPlugin = require('gas-build').default","symbol":"gasBuildPlugin","correct":"const { gasBuildPlugin } = require('gas-build')"},{"note":"Preferred method: use npx or a script in package.json. Avoid calling the binary directly.","wrong":"node ./node_modules/.bin/gas-build src/index.ts --outfile dist/bundle.js","symbol":"CLI","correct":"npx gas-build src/index.ts --outfile dist/bundle.js"}],"quickstart":{"code":"// build script: build.mjs\nimport { build } from 'esbuild';\nimport { gasBuildPlugin } from 'gas-build';\n\nawait build({\n  entryPoints: ['src/index.ts'],\n  bundle: true,\n  outfile: 'dist/bundle.js',\n  platform: 'node',\n  target: 'es2020',\n  format: 'esm',\n  plugins: [gasBuildPlugin()],\n});\n\n// Run with: node build.mjs","lang":"typescript","description":"Bundles a TypeScript entry point into a single file for Google App Script using the ESBuild plugin."},"warnings":[{"fix":"Always use `outfile` instead of `outdir` when using the plugin.","message":"Options like `outdir` (instead of `outfile`) may not be supported; plugin expects a single output file.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Set `format: 'esm'` or omit to default to 'iife' (GAS compatible). Avoid 'cjs'.","message":"The plugin does not warn if `format` is missing. If set incorrectly, output may not work in GAS runtime.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Run `npm install -D gas-build esbuild`.","message":"ESBuild must be installed as a separate peer dependency. The package does not include it.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Pin to latest version and test build after update.","message":"Version 0.0.3 may have breaking changes from earlier 0.0.x versions; no changelog provided.","severity":"breaking","affected_versions":"<0.0.3"}],"env_vars":null,"search_vec":"'0.24.2':37 'activ':53 'app':16 'build':3 'bundl':10,21 'cli':7 'code':13 'combin':19 'depend':34 'differenti':38 'e.g':28 'esbuild':4,20,36,51 'gas':2,18,26,44 'gas-build':1 'gas-specif':43 'googl':15 'google.script.run':31 'handl':29 'javascript':57 'maintain':54 'modern':11 'need':40 'pass':49 'peer':33 'plugin':5,52 'requir':24 'runtim':27 'salsita':56 'script':17 'scriptapp':32 'separ':42 'singl':48 'specif':45 'step':47 'transform':23 'transpil':46 'typescript':58 'typescript/javascript':12 'v0.0.3':8 'via':50","created_at":"2026-05-01T13:45:40.216340+00:00","updated_at":"2026-05-01T13:45:40.216340+00:00","problems":[{"fix":"Add `google` to the `define` option in ESBuild config (e.g., `define: { 'google': '{}' }`), or use the plugin's built-in handling.","cause":"The plugin expects GAS-specific globals to be used as such; ESBuild does not resolve them.","error":"Error: Build failed with 1 error: ... Could not resolve 'google.script.run'"},{"fix":"Use `import { gasBuildPlugin } from 'gas-build'`.","cause":"Importing default export instead of named export.","error":"TypeError: gasBuildPlugin is not a function"},{"fix":"Run `npm install -D gas-build esbuild`.","cause":"Package not installed or node_modules not present.","error":"Error: Cannot find module 'gas-build'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"gas-build","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/salsita/gas-build","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/gas-build","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","http-networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}