Skip to content

Commit 1a5f4fe

Browse files
authored
Merge pull request #5 from lc-tut/fix/cd-dekinai-1
fix: application.tsがなくcdが通らない問題を解消
2 parents 6ef1c0b + 40b8289 commit 1a5f4fe

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

esbuild.js

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
1-
import esbuild from "esbuild";
2-
import { GasPlugin } from "esbuild-gas-plugin";
1+
import esbuild from 'esbuild';
2+
import { GasPlugin } from 'esbuild-gas-plugin';
3+
import { copyFileSync, mkdirSync } from 'fs';
4+
5+
// distフォルダを作成(存在しない場合)
6+
mkdirSync('./dist', { recursive: true });
7+
8+
// appsscript.jsonをコピー
9+
copyFileSync('./src/appsscript.json', './dist/appsscript.json');
310

411
esbuild
512
.build({
6-
entryPoints: ["./src/main.ts"],
13+
entryPoints: ['./src/main.ts'],
714
bundle: true,
815
minify: true,
9-
outfile: "./dist/main.js",
16+
outfile: './dist/main.js',
1017
plugins: [GasPlugin],
1118
})
12-
.catch((error) => {
13-
console.log('ビルドに失敗しました')
19+
.then(() => {
20+
console.log('✅ Build succeeded!');
21+
})
22+
.catch(error => {
23+
console.log('❌ ビルドに失敗しました');
1424
console.error(error);
1525
process.exit(1);
1626
});

src/appsscript.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"timeZone": "Asia/Tokyo",
3+
"dependencies": {},
4+
"exceptionLogging": "STACKDRIVER",
5+
"runtimeVersion": "V8"
6+
}

0 commit comments

Comments
 (0)