Use /dist dir for Cloud Functions deployment payload

This commit is contained in:
Marshall Polaris 2022-06-23 20:22:42 -07:00
parent a24ee9c9dd
commit 2fa449cdac
3 changed files with 8 additions and 4 deletions

View File

@ -1,8 +1,8 @@
{
"functions": {
"predeploy": "npm --prefix \"$RESOURCE_DIR\" run build",
"predeploy": "cd functions && yarn build",
"runtime": "nodejs16",
"source": "functions"
"source": "functions/dist"
},
"firestore": {
"rules": "firestore.rules",

View File

@ -2,6 +2,9 @@
.env*
.runtimeconfig.json
# GCP deployment artifact
dist/
# Compiled JavaScript files
lib/

View File

@ -5,7 +5,8 @@
"firestore": "dev-mantic-markets.appspot.com"
},
"scripts": {
"build": "tsc",
"build": "yarn compile && rm -rf dist && mkdir -p dist/functions && cp -R ../common/lib dist/common && cp -R lib/src dist/functions/src && cp ../yarn.lock dist && cp package.json dist",
"compile": "tsc -b",
"watch": "tsc -w",
"shell": "yarn build && firebase functions:shell",
"start": "yarn shell",
@ -18,7 +19,7 @@
"db:backup-remote": "yarn db:rename-remote-backup-folder && gcloud firestore export gs://$npm_package_config_firestore/firestore_export/",
"verify": "(cd .. && yarn verify)"
},
"main": "lib/functions/src/index.js",
"main": "functions/src/index.js",
"dependencies": {
"@amplitude/node": "1.10.0",
"fetch": "1.1.0",