Skip to content

Commit 0263764

Browse files
docs: add instructions for deploying with typescript codebase (#417)
Update typescript readme as proposed in [issue](#254)
1 parent bcfc183 commit 0263764

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/typescript.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,22 @@ the Functions Framework.
5454
Function: helloWorld
5555
URL: http://localhost:8080/
5656
```
57+
58+
## Deploying with gcloud CLI
59+
60+
1. Adjust `main` field in `package.json` to point to the compiled javascript source.
61+
62+
```js
63+
"main": "build/src/index.js",
64+
...
65+
```
66+
67+
1. Remove `prepare` script in `package.json` created by [gts](https://github.com/google/gts). This is because the `prepare` script requires typescript to be installed and will cause the function to fail to deploy if not removed.
68+
69+
1. Deploy:
70+
71+
```sh
72+
gcloud functions deploy helloWorld \
73+
--runtime nodejs16 \
74+
--trigger-http
75+
```

0 commit comments

Comments
 (0)