File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff 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
6283The normal Serverless deploy procedure will automatically compile with Typescript :
You can’t perform that action at this time.
0 commit comments