https://github.com/mahaker/esbuild-gas-plugin
esbuild plugin for Google Apps Script.
https://github.com/mahaker/esbuild-gas-plugin
deno esbuild esbuild-plugin gas google-apps-script hacktoberfest typescript
Last synced: 16 days ago
JSON representation
esbuild plugin for Google Apps Script.
- Host: GitHub
- URL: https://github.com/mahaker/esbuild-gas-plugin
- Owner: mahaker
- License: mit
- Created: 2021-06-27T13:53:38.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-10T11:54:28.000Z (about 1 month ago)
- Last Synced: 2025-03-29T21:02:53.463Z (23 days ago)
- Topics: deno, esbuild, esbuild-plugin, gas, google-apps-script, hacktoberfest, typescript
- Language: TypeScript
- Homepage:
- Size: 116 KB
- Stars: 36
- Watchers: 1
- Forks: 8
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# esbuild-gas-plugin
[](https://www.npmjs.com/package/esbuild-gas-plugin)
esbuild plugin for Google Apps Script.
This is inspired by [gas-webpack-plugin](https://github.com/fossamagna/gas-webpack-plugin).
## Install
```
npm install -D esbuild-gas-plugin
// or
yarn add -D esbuild-gas-plugin
// or
pnpm add -D esbuild-gas-plugin
```## Usage
Add this to Your build script file, and paste `dist/bundle.js` to script editor.
A simple example can be found in [here](https://github.com/mahaker/openapi-gas-example).
### Node
```ts
// build.js
const { GasPlugin } = require('esbuild-gas-plugin');require('esbuild').build({
entryPoints: ['src/index.ts'],
bundle: true,
outfile: 'dist/bundle.js',
plugins: [GasPlugin]
}).catch((e) => {
console.error(e)
process.exit(1)
})
```and
```sh
node build.js
```### Deno
```ts
// build.ts
import { build, stop } from 'https://deno.land/x/[email protected]/mod.js'
import { GasPlugin } from 'npm:[email protected]'
import httpFetch from 'https://deno.land/x/[email protected]/index.js'await build({
entryPoints: ['src/index.ts'],
bundle: true,
outfile: 'dist/bundle.js',
plugins: [httpFetch, GasPlugin ]
})
stop()
```and
```sh
deno run --allow-read --allow-env --allow-run --allow-write build.ts
# or
deno run -A build.ts
```