New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gas-build

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gas-build

ESBuild plugin and CLI for bundling modern TS/JS code into Google App Script

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
210
Maintainers
0
Weekly downloads
 
Created
Source

Gas Build

An ESBuild plugin and simplified CLI for bundling of Google App Script projects from a modern TypeScript / JavaScript codebase.

Installation

npm install -D gas-build esbuild

This installs both the plugin and the CLI. Note that esbuild is declared as a peer dependency and must be installed separately.

Usage

CLI

This is a preferred method for simple projects with a single entry point.

To build your project, call the gas-build command with the entry point file and the output file:

gas-build src/index.ts --outfile dist/bundle.js

Note that you might have to wrap the command in a package.json script so that the gas-build is properly recognized:

{
  "scripts": {
    "build": "gas-build src/index.ts --outfile dist/bundle.js"
  }
}
Watch mode

The CLI also supports simple watch mode. Enable it by passing the --watch flag:

gas-build src/index.ts --outfile dist/bundle.js --watch

Plugin

When the CLI is not sufficient, you can use the plugin directly in your build script. Define a custom build script, using the esbuild API, and include the gasBuildPlugin.

// filename: build.mjs
import { build } from 'esbuild'
import { gasBuildPlugin } from 'gas-build'

await build({
  entryPoints: ['src/index.ts'],
  bundle: true,
  // make sure there is a single output file
  // for the pluging to process
  outfile: 'dist/bundle.js',
  platform: 'node',
  target: 'es2020',
  format: 'esm',
  plugins: [gasBuildPlugin()],
})

Run the build script using node:

node build.mjs

FAQs

Package last updated on 03 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc