-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathgas-build.js
More file actions
36 lines (34 loc) · 900 Bytes
/
gas-build.js
File metadata and controls
36 lines (34 loc) · 900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const { GasPlugin } = require("esbuild-gas-plugin");
const esbuild = require("esbuild");
esbuild
.build({
entryPoints: ["src/gas/index.ts"],
bundle: true,
outfile: "apps-script/bundle.js",
plugins: [GasPlugin],
// resolve `VERSION` variable with the value from package.json
define: {
VERSION: JSON.stringify(require("./package.json").version),
LOG_LEVEL: JSON.stringify(process.env.LOG || "INFO"),
},
})
.then(() => {
// add banner to the generated file
esbuild
.build({
entryPoints: ["apps-script/bundle.js"],
outfile: "apps-script/bundle.js",
allowOverwrite: true,
banner: {
js: "//This file is generated by gas-build.js",
},
})
.catch((e) => {
console.error(e)
process.exit(1)
});
})
.catch((e) => {
console.error(e)
process.exit(1)
});