Skip to content

Commit facd2b3

Browse files
committed
Updated readme include GCF docs
1 parent 62070ca commit facd2b3

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,27 @@ All files from `package/include` will be included in the final build file. See [
5757

5858
## Usage
5959

60+
### Google Cloud Functions
61+
62+
When using with Google Cloud Functions via the [serverless-google-cloudfunctions](https://github.com/serverless/serverless-google-cloudfunctions)
63+
plugin, you simply have to provide a `main` field in your `package.json`:
64+
65+
```js
66+
{
67+
// ...
68+
"main": "handler.js",
69+
// ..
70+
}
71+
```
72+
73+
And this plugin will automatically compile your typescript correctly. Note
74+
that the field must refer to the compiled file name, namely, ending with a `.js`
75+
extension.
76+
77+
If a `main` field was not found, then this plugin will use `index.js`. Before
78+
compilation begins, it will check to see that the file indicated exists with a
79+
`.ts` extension before actually trying to compile it.
80+
6081
### Automatic compilation
6182

6283
The normal Serverless deploy procedure will automatically compile with Typescript:

0 commit comments

Comments
 (0)